‎2006 Jan 18 12:23 PM
I want to find out if a set of users has the authorization to execute a particular transaction.
I want to write a list of the same.
More specifically I am looking for a function module which can give me this.
‎2006 Jan 18 12:26 PM
‎2006 Jan 18 12:27 PM
Hi,
Look at below FM
SUSR_GET_PROFILES_OF_USER
SUSR_GET_PROFS_WITH_SPEC_PROFS
SUSR_GET_TCODES_AUTH_S_TCODE
SUSR_GET_TCODES_WITH_AUTH
SUSR_GET_TCODES_WITH_OBJ
Regards
Amole
‎2006 Jan 18 12:28 PM
Hi ,
Please check this <a href="http://www.guidancetech.com/people/holland/sap/abap/zzbgs092.htm">Link</a> .This will give a program which give overview of profiles and authorizations.
Hope This Info Helps YOU.
<i>
Reward Points If It Helps YOU.</i>
Regards,
Raghavendra
‎2006 Jan 18 12:34 PM
Hi gerson,
you can get list of tcode executable for user with this report RSUSR01. hope this help you.
regards,
John
‎2006 Jan 18 12:41 PM
‎2006 Jan 18 1:17 PM
‎2006 Jan 18 1:29 PM
Stephen,
This actually has not worked. If returns successful in both cases i.e. even if you have or dont have the authorization to a transaction.
Could you help
Regards
Gerson
‎2006 Jan 18 1:40 PM
‎2006 Jan 18 1:44 PM
small correction to stephan's code,
It should be sy-subrc = 0 , i think.
‎2006 Jan 18 1:47 PM
‎2006 Jan 18 1:49 PM
‎2006 Jan 18 1:50 PM
lolz..'change the specification according to your code..'..:)..
‎2006 Jan 18 2:00 PM
REPORT ztest_sidskai4 .
PARAMETERS : p_usr TYPE xubname.
PARAMETERS : p_tcode TYPE tcode.
START-OF-SELECTION.
DATA : value TYPE ust12-von .
DATA : text TYPE tstct-ttext.
value = p_tcode.
CALL FUNCTION 'AUTHORITY_CHECK'
EXPORTING
user = p_usr
object = 'S_TCODE'
field1 = 'TCD'
value1 = value
EXCEPTIONS
user_dont_exist = 1
user_is_authorized = 2
user_not_authorized = 3
user_is_locked = 4
OTHERS = 5.
<b> IF sy-subrc = 2.
SELECT SINGLE ttext
INTO text
FROM tstct
WHERE tcode = value AND sprsl = sy-langu.
WRITE : / value , text.
MESSAGE s016(rp) WITH 'ALLOW |' p_usr value text.
ELSEIF sy-subrc = 3.
SELECT SINGLE ttext
INTO text
FROM tstct
WHERE tcode = value AND sprsl = sy-langu.
MESSAGE s016(rp) WITH 'NOT ALLOW |' p_usr value text.
ENDIF.</b>
‎2006 Jan 18 2:17 PM
Test should look like this :
EXCEPTIONS
user_dont_exist = 1
user_is_authorized = 2
user_not_authorized = 3
user_is_locked = 4
OTHERS = 5.
IF sy-subrc = 2.
SELECT SINGLE ttext
INTO text
FROM tstct
WHERE tcode = value AND sprsl = sy-langu.
WRITE : / value , text.
MESSAGE s016(rp) WITH 'ALLOW |' p_usr value text.
ELSEIF sy-subrc = 3.
SELECT SINGLE ttext
INTO text
FROM tstct
WHERE tcode = value AND sprsl = sy-langu.
MESSAGE s016(rp) WITH 'NOT ALLOW |' p_usr value text.
ENDIF.
‎2006 Jan 18 2:45 PM
‎2006 Jan 19 1:54 PM