December 28, 2012

Get the SNC mappings of the ABAP users of a system

The SNC mappings of the users on the ABAP systems are stored on the ACLs tables, in this case, on the particular USRACL table. To obtain the SNC string of a user is enough to perform a simple query of the USRACL and see which users are related. In the following example I've also selected data from the USR02 table as I wanted to validate the status of the user.

Select p.MANDT, p.BNAME, p.UFLAG, CLASS, b.PNAME
from hsx.USR02 p
cross apply (Select * from tst.USRACL) b
where b.BNAME = p.BNAME and p.MANDT = b.MANDT and p.MANDT=320;