AUTHORITY_CHECK_TCODE
You can provide your transaction code replacing the one below whose user authority you want to check.
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
tcode = 'PC_PAYRESULT' "Your Transaction code
EXCEPTIONS
ok = 0
not_ok = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e172(00) WITH 'PC_PAYRESULT'.
ENDIF.