函数:abap自定义权限检查函数
FORM frm_authority_check.
* DATA: l_return_num TYPE i.
CALL FUNCTION 'Z_03FI_AUTH_CHECK'
EXPORTING
i_bukrs = p_code
i_actvt = '03'
* IMPORTING
* E_RETURN = l_return_num .
.
ENDFORM. "frm_authority_check
FUNCTION Z_03FI_AUTH_CHECK .
*"----------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(I_BUKRS) TYPE BUKRS DEFAULT '1201'
*" REFERENCE(I_ACTVT) TYPE ACTIV_AUTH
*" EXPORTING
*" REFERENCE(E_RETURN) TYPE SY-SUBRC
*"----------------------------------
DATA: l_mod(10) TYPE c.
CLEAR l_mod.
CASE i_actvt.
WHEN '01'.
l_mod = '创建'.
WHEN '02'.
l_mod = '修改'.
WHEN '03'.
l_mod = '查询'.
WHEN OTHERS.
l_mod = '操作'.
ENDCASE.
AUTHORITY-CHECK OBJECT 'Z03FI001'
ID 'BUKRS' FIELD i_bukrs
ID 'ACTVT' FIELD i_actvt.
e_return = sy-subrc.
IF sy-subrc <> 0.
MESSAGE e114(z03) WITH i_bukrs l_mod.
ENDIF.
ENDFUNCTION.