RSUSR_CLEANUP_USER_TABLES: Display and delete unneeded entries in user tables

Report RSUSR_CLEANUP_USER_TABLES analyzes the user administration tables for inconsistent data for users that no longer exist in this client or that have never existed in this client, and can remove the inconsistent data. (In some cases, this data can lead to short dumps of the type SAPSQL_ARRAY_INSERT_DUPREC” “CX_SY_OPEN_SQL_DB” when creating these users.)

Selection Screen of the Report

On the selection screen, you can decide whether to use the report only for analysis, or whether it should also offer the option to delete data. Use the checkbox Test Mode (technical name: sc_test) to do this. The default value for this checkbox is always “X”.

The option “Delete the User SPACE” (technical name: sc_space) is only accessible if you deactivate test mode. It is not possible to perform a pre-test in this report to determine whether the SPACE user exists.
With this option, you can decide whether to delete the user, which should not exist. For more information, see SAP Note 441215. This option is preselected.
If it exists, the report deletes the USR02 entry for the user and displays all other occurrences of the user in other tables, together with all inconsistencies in the results list. You can then handle these in the same way as any other inconsistent entries.

You can use the checkbox Include CUA Tables (technical name: sc_cua) to reduce the scope of the analysis if you have never operated an active Central User Administration. To do this, deselect the checkbox.

You can use the checkbox Check System Assignments (technical name: sc_assgn) to perform additional data analysis on obsolete system-specific user attributes, such as profile assignments, role assignments, or license data assignments.
You can only select this option if you also select the option “Include CUA Tables”.

To see all checked tables in the result list of the analysis, even if no inconsistent data was found for some tables, deactivate the checkbox Display Affected Tables Only.

You can use the selection option User Name (technical name: sc_user), to specify individual user names or ranges that you want to search for inconsistent data.

We recommend that, for systems with a large number of users, or for systems in which a large number of changes have been made to user master records, you make suitable restrictions. This can significantly reduce the runtime of the report.

Data Analysis

The report checks all user tables using the users that exist in table USR02. It determines all table entries from the related tables relevant for users for which the user has not yet also been defined in table USR02.

With the additional analysis controlled by the checkbox “Check System Assignments”, the report checks system-specific profile assignments, role assignments, and license data assignments against the system assignments of a user in a CUA landscape (table: USZBVSYS).

Results List

a) Overview

The header area of the result list contains technical information about the execution of the report (system ID, client, executing user, date and time of the execution), and a list of the selection criteria that you chose.

The list header contains, among other things, the number of users for which inconsistent data was found.

The first column of the list itself contains all of the user names for which the report found inconsistent entries in the following tables. The numbers displayed in the individual table fields show the number of table rows found in the table for the user.

To display this content, double-click either the corresponding field, the table name, or the selection column for a user name. You can call the same function by choosing the pushbutton “Display Data Records” (Ctrl+Shift+F1) or by choosing the first entry of the “Goto” menu. If you use the last of these options, you can also display the content for multiple users and/or tables.

If you have not started the report in test mode, the system also displays two additional options in the toolbar and in the “List” menu.

  • Delete Selected Entries
    • If you choose this button, the system irrevocably deletes all inconsistent data records in the rows that you have selected. If the report determines that a reference user entered for a user does not exist or no longer exists, the name of the reference user is only removed from the corresponding table field (USREFUS-REFUS).
    • The deletion of data enters the following warning message C4 1 in the system log (transaction SM21): Application RSUSR_CLEANUP_USER_TABLES warns: inconsistent data deleted.
    • The most important factor when selecting a suitable system log message was not to create any new system log messages, to be able to port the report to all supported releases. Depending on your own assessment, you can therefore either ignore this message or include it in your monitoring.
  • Refresh
    • This function updates the display in the overview list so that the rows for the data you have just deleted are removed.

b) Detail View

The detail view is sorted by user name and table.

To display all table contents in a uniform format, the key fields of a table are combined in the column “Table Key” and all other fields are combined in the column “Row Content”.

Behavior of the Report in Background Processing

  • Executing in Test Mode
    • The spool list of the background job contains only the overview list.
  • Execution in Deletion Mode (“Test Mode” checkbox is not selected)
    • The system immediately and irrevocably deletes all of the inconsistent data found with the selection option “User Name”.
    • In this case, however, the spool list contains the detail list, as a confirmation of the data that was deleted.

Requirements

There are a number of different possible causes of this inconsistency.
For example, they could originate in direct manipulation of the database, programming errors (see SAP Note 1339537), client copies or system copies, or transports.

You May Also Like

Leave a Reply?