Skip to Content
Technical Articles
Author's profile photo Jigang Zhang 张吉刚

Get the SAP user ID which been deleted by email address

It’s common that we need to check the SAP ID for a specific user by her/his email address. And it’s well known that SAP user ID and accordingly email address stored at table ADR6 and USR21.

But what if the user ID been deleted afterward? There’ll be no entry existed for table ADR6 and USR21 at all. It’s easy to find out following the below steps:

1, Put the email address at ADR6-SMTP_ADDR to get the address number(ADDRNUMBER) and person number(PERSNUMBER) by SE11/SE16.

2. Using the address number and person number fetched from above, you can get the SAP user ID directly at table USR21 by field BNMAE of course if this user ID not been deleted yet.

3, If no result from above, then go to table ADR7 using the address number and person number to get the User ID by field UNAME. Done! It’ll be there even been deleted.

Besides: It’ll comes the question of when this user ID been deleted? It’s straight forward as well by the table USH04 by field PROFS.

       Field PROFS is an LCHR type, can’t be used as an input parameter. Just input the user ID for the field BNAME, and then check the result entry which PROFS is ‘D’ will get the deleted time stamp.

Or using the program RSUSR100 to check all change history using a specific user ID.

There is another way to check this may be quicker than this, just maybe:

  • Guess the naming rule based on other email address and their SAP user ID in Table USR21.
  • Then using Wildcard search like ‘L*F*’ based first name/last name in Table ADR7. Haha

Maybe Basis could have a better way to achieve this.

 

Assigned tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Michelle Crapo
      Michelle Crapo

      Well...  I haven't ever had to retrieve a deleted user.   We tend to use the validity period.   Then the transaction SUIM will work.  This is an interesting way of doing things.  What version of SAP are you on?

      Author's profile photo Jigang Zhang
      Jigang Zhang
      Blog Post Author

      @ Michelle Crapo

      Thanks for the comments. Just try it and You’re right, SUIM is a better approach! Just using the first name and last name get from the mail address will do. My method can be used at customized program logic   : P

      Btw, we are using SAP ECC 6.0

      Author's profile photo Michelle Crapo
      Michelle Crapo

      True - it could easily be added to a program.   Thank you for letting me know the version!  It does make a difference.  😉

      Author's profile photo Jigang Zhang
      Jigang Zhang
      Blog Post Author
      Thanks. Do you mean version matters? Is this workable for HANA?