At selection-screen output.
AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD 'ZTCODE'.
* ZTCODE is the tranaction code
if sy-subrc ne 0.
message i000 with 'You are Not Authorized to execute this transaction'.
exit.
endif.
At selection-screen output.
AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD 'ZTCODE'.
* ZTCODE is the tranaction code
if sy-subrc ne 0.
message i000 with 'You are Not Authorized to execute this transaction'.
exit.
endif.