Code: Alles auswählen.
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
TCODE = sy-tcode
EXCEPTIONS
OK = 1
NOT_OK = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
Code: Alles auswählen.
AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD TCODE.
if sy-subrc ne 0.
* Keine Berechtigung
else.
* Alles Ok
endif.
Code: Alles auswählen.
data tcode type sytcode.
*und zum Beispiel:
tcode = 'SA38'.
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
TCODE = tcode
EXCEPTIONS
OK = 0
NOT_OK = 1
OTHERS = 2 .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ELSE.
* Alles Ok
ENDIF.