Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP table for Deleted Users

Former Member
0 Kudos

Hi,

Can someone Pl tell us the SAP table name that stores Deleted Users Records.

Our requirement is we need to display a list of Deleted User in last 3 months. But I am not able to identify deleted users in USR02 table.

Pl advise

Thanks

Hardik

9 REPLIES 9

Former Member
0 Kudos

Hi Hardik,

The tables are USR02, USR04, UST10S

Also If you know the actual user-id you will find the persnumber in ADR7 (fields ADR7-UNAME and ADR7-PERSNUMBER): look it up via ADR7-UNAME.

With that persnumber you should be able to find the real name of that user-id in table ADRP (field ADRP-PERSNUMBER and e.g. ADRP-NAME_TEXT).

Regards

Abhii

Edited by: Abhii on Dec 7, 2009 1:48 PM

0 Kudos

Thanks Abhii,

But how do I identify if the user is deleted or not?

My reqiremet is read all users from USR02 and find out those users deleted in last 3 months.

Thanks

Hardik

0 Kudos

Hi Hardik,

USH04 will tell when was the user deleted. Since a user cannot login to the system once deleted, USH04 timestamp will be greater than USH02. i.e. the user was deleted after the last login.

Regards

Abhii

0 Kudos

Hi,

try report: RSUSR100.

regards, Dieter

0 Kudos

Hello Hardik,

I find that a deleted user does not exist in USR02, but it will exist in USH02.

Also check the t-code S_BCE_68001439(program RSUSR100), there are change docs created for users which are deleted. Debug the code & find out how the program behaves

Added:

I just check the code in the program RSUSR100, you can check the field USH04-PROFS. For deleted users you will get the line with USH04-PROFS = 'D'.

@Abhii: I think USH04 is for Change History for Auth. How does it tell the user is deleted?

BR,

Suhas

Former Member
0 Kudos

Hello

USH04. If user was deleted - USH04-PROFS = 'D'

Former Member
0 Kudos

Hi Hardik,

Try with USH02 & USH04 as I suggested earlier, you will find an answer. Also if you need to know any user ID locked or not use RSUSR200.

Rehards

Abhii

former_member183872
Participant
0 Kudos

Hi Hardik,

Dieter Gröhn has already given you the report which will help you to find out the list of users deleted.

Use the different selection to generate the list as you want.

Execute RSUSR100

1. In the selection screen select the start date and end date.

2. Selection cretarion for Changed Authorizations - Select only "Deleted Users"

3. Selection cretarion for Changed Header Data - Deselect all.

This will give you the list of users those were deleted in the period mentioned.

Thanks Dieter Gröhn.

Regards,

Anuj Nigam

kesavadas_thekkillath
Active Contributor

Check the table USH04 where PROFS = 'D'

check this copied code


FORM CHECK_FOR_DELETED_USER. 
* When a user is deleted, a record is written to ush04, with nrpro = 1 
* and the first byte of profs = 'D'.  If the same user is then created, 
* another record is written, with a different nrpro value and with 
* profs = 'C'.  This form captures all these records and positions us 
* at the most recent one so we can check for a 'D'. 
  CLEAR ITAB4. 
  REFRESH ITAB4. 
  SELECT * FROM USH04 
    WHERE BNAME EQ ITAB1-BNAME 
      AND MODDA LE ITAB1-MODDA 
      AND MODDA GE ITAB2-MODDA. 
* Check that record is prior to current change. 
    IF USH04-MODDA EQ ITAB1-MODDA. 
      CHECK USH04-MODTI LT ITAB1-MODTI. 
    ENDIF. 
* Check that record is later than any previous change.  (This is needed 
* because simple changes to a user, such as a password change, do not 
* result in a record written to ush04.) 
    IF USH04-MODDA EQ ITAB2-MODDA. 
      CHECK USH04-MODTI GT ITAB2-MODTI. 
    ENDIF. 
    MOVE: USH04-BNAME    TO ITAB4-BNAME, 
          USH04-MODDA    TO ITAB4-MODDA, 
          USH04-MODTI    TO ITAB4-MODTI, 
          USH04-NRPRO    TO ITAB4-NRPRO, 
          USH04-PROFS(1) TO ITAB4-PROFS. 
    APPEND ITAB4. 
  ENDSELECT. 

Edited by: Keshav.T on Jan 6, 2010 7:34 PM