SAP Function SUSR_USER_AUTH_FOR_OBJ_GET - Display authorizations (for a specified object) belonging to a user

Parameter Reference Type Length Default Optional Text
MANDANT SYST-MANDT C 3 SY-MANDT X SAP System, Client Number from Logon
NEW_BUFFERING XUFLAG C 4 3 X Flag for various authorization programs
SEL_OBJECT UST12-OBJCT C 10 X Authorization object for restriction
USER_NAME USR02-BNAME C 12 User Name in User Master Record

Parameter Reference Length Optional Text
VALUES USVALUES 112 Field values

Exception Text
INTERNAL_ERROR Internal error
NOT_AUTHORIZED No authorization
USER_NAME_NOT_EXIST User name does not exist

Functionality
User authorizations are output in an internal table. It is possible torestrict these authorizations to specified authorization objects.

Example
You want to know whether user TESTUSER has authorization to startTransaction SU01. The user requires authorization for object S_TCODEwith the value 'SU01' in field TCD to be able to do this.
data: begin of values occurs 10.
include structure usvalues.
data: end of values.
call function 'SUSR_USER_AUTH_FOR_OBJ_GET'
exporting
user_name = 'TESTUSER'
SEL_OBJECT = 'S_TCODE'
tables
values = values
exceptions
user_not_exist = 1
not_authorized = 2
internal_error = 3
others = 4.
Output: Table VALUES
OBJCT AUTH FIELD FROM TO
S_TCODE S_TCD_SAP TCD ' ' W*
S_TCODE S_TCD_SAP TCD 0 9*
S_TCODE S_TCD_SAP TCD XK Z*
Value 'SU01' is between ' ' and W*, therefore the user has theauthorization to start the transaction.

Notes
Note that for the authorization check, the system usually checkscombinations of field values that must belong to the sameauthorization. Therefore you should not ignore the field VALUES-AUTH,as this shows the identity of the field values.

Description
Name of the user in the user master record.

Description
VALUES: List of authorizations of user USER_NAME
Fields: - OBJCT : Authorization object
- AUTH : Authorization
- FIELD : Field name
- FROM : Lower limit for field values
- TO : Upper limit for field values

740966GET_AUTH_VALUES returns empty result (incorrectly)