2005 Dec 15 7:25 AM
Hi,all
How to check if user has authorization with transaction code AAA in ABAP? Could you give me the steps with your comment where you had better told me why ?
2005 Dec 15 7:35 AM
Hi chen,
You can use function module AUTHORITY_CHECK_TCODE for this. Some thing like,
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
TCODE = <Your Tcode here>
EXCEPTIONS
OK = 0
NOT_OK = 1
OTHERS = 2.
IF sy-subrc <> 0.
****No Authorization
ENDIF.
Hope this helps..
Sri
2005 Dec 15 7:27 AM
RUn transaction AAA
and then run SU53 then you can see the list of authorizations..
for the user..
2005 Dec 15 7:30 AM
And se97 you can set the authorization for the transaction.
and also you can see the authorizations..
Message was edited by: Vijay Babu Dudla
2005 Dec 15 7:35 AM
Hi chen,
You can use function module AUTHORITY_CHECK_TCODE for this. Some thing like,
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
TCODE = <Your Tcode here>
EXCEPTIONS
OK = 0
NOT_OK = 1
OTHERS = 2.
IF sy-subrc <> 0.
****No Authorization
ENDIF.
Hope this helps..
Sri
2005 Dec 15 7:40 AM
You can use the authority-check statement in the code and use object s_tcode.