SAP 권한 체크 로직 추가
SU21에서 권한 OBJECT를 찾는다.
프로그램상에서 해당 권한 OBJECT CHECK 로직 작성
AT SELECTION-SCREEN ON S_WERKS.
PERFORM CHECK_AUTHORIZATION.
*&---------------------------------------------------------------------*
*& Form CHECK_AUTHORIZATION
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM CHECK_AUTHORIZATION .
DATA : BEGIN OF LT_WERKS OCCURS 0,
WERKS LIKE T001W-WERKS,
END OF LT_WERKS.
CLEAR : LT_WERKS, LT_WERKS[].
SELECT WERKS
INTO CORRESPONDING FIELDS OF TABLE LT_WERKS
FROM T001W
WHERE WERKS IN S_WERKS.
* "Check Authorization Object
LOOP AT LT_WERKS.
AUTHORITY-CHECK OBJECT 'M_MSEG_WMB'
ID 'ACTVT' FIELD '03'
ID 'WERKS' FIELD LT_WERKS-WERKS.
IF SY-SUBRC NE 0.
MESSAGE E003 WITH 'Non-authorized Plant ' LT_WERKS-WERKS ' entered'.
ENDIF.
ENDLOOP.
FREE : LT_WERKS.
ENDFORM. " CHECK_AUTHORIZATION
댓글 없음:
댓글 쓰기