Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Custom T.code Authorization

Former Member
0 Likes
463

Hi All,

i have to check whether user has an authorization for custom t.code.

say for example i have a custom program assign in t.code. if the user 'USANP' execute that t.code , in my program itself i have to check authorization.

please give me some hints,

thanks,

john.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
415

CALL FUNCTION 'AUTHORITY_CHECK_TCODE'

EXPORTING

tcode = 'SM59'

EXCEPTIONS

ok = 0

not_ok = 1

OTHERS = 2.

IF sy-subrc NE 0.

MESSAGE e172(00) WITH 'SM59'.

ENDIF.

2 REPLIES 2
Read only

Former Member
0 Likes
416

CALL FUNCTION 'AUTHORITY_CHECK_TCODE'

EXPORTING

tcode = 'SM59'

EXCEPTIONS

ok = 0

not_ok = 1

OTHERS = 2.

IF sy-subrc NE 0.

MESSAGE e172(00) WITH 'SM59'.

ENDIF.

Read only

Former Member
0 Likes
415

Hi John,

Check this

DATA : L_TCODE LIKE SYST-TCODE.

L_TCODE = 'VA02'.

*-Check whether user is authorized

CALL 'AUTH_CHECK_TCODE'

ID 'TCODE' FIELD L_TCODE.

IF SY-SUBRC <> 0.

MESSAGE S000(ZVA02) WITH TEXT-116 'ZVA02'.

LEAVE PROGRAM.

ENDIF.

Regards,

Vidya