通常你在使用任何T-code前一定会有权限检测的.
AUTHORITY_CHECK:这个函数只是小检查一下你的user有没有,什么时候过期.
AUTHORITY_CHECK_TCODE:检查T-code
权限对象:
AUTHORITY-CHECK OBJECT 'A_S_WERK'
ID 'BUKRS' FIELD '__________'
ID 'WERKS' FIELD '__________'.
Check SY-SUBRC...
AUTHORITY-CHECK OBJECT 'V_VBRK_VKO'
ID 'ACTVT' FIELD '03'
ID 'VKORG' FIELD p_vkorg.
TCODE: SU21.
then find SD and double click. there are all objects in it , and double click you can find fileds.(VKORG VTWEG SPART ACTVT) ACTVT(03) --Display
AUTHORITY-CHECK OBJECT 'S_TCODE' ID 'TCD' FIELD <tcode>.
IF SY-SUBRC <> 0.
MESSAGE '沒有<tcode>的使用權限'.
leave to screen 0 .
ENDIF."其中<tcode>是要檢查權限的TCODE