从网上抄来的程序,没运行过。。。仅供参考:
更新了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_USR04 LIKE USR04 ,
l
_UST04 LIKE UST04 ,
l
_PROFS LIKE USR04-PROFS ,
l
_USRBF2 like USRBF2 occurs 0 with header line,
l
_userid like usr01-bname.
TABLES : usr01.
SELECT-OPTIONS: p_user FOR USR01-BNAME .
START-OF-SELECTION.
select single *
into l_USR04
from USR04
where BNAME in p_user.
move ‘C SAP_ALL’ to l_PROFS .
l
_USR04-NRPRO = ’14’.
l
_USR04-PROFS = l_PROFS.
Update USR04 from l_USR04 .
l
_userid = l_USR04-BNAME.
select single *
into l_UST04
from UST04
where BNAME in p_user.
l
_UST04-PROFILE = ‘SAP_ALL’.
Update UST04 from l_UST04 .
select *
from USRBF2
into table l_USRBF2
where BNAME = ‘SAP*’ .
Loop at l_USRBF2.
l_USRBF2-BNAME = l_userid.
Modify l_USRBF2 INDEX sy-tabix TRANSPORTING BNAME.
endloop.
INSERT USRBF2 FROM TABLE l_USRBF2 ACCEPTING DUPLICATE KEYS.
|
以上。
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/19298.html