TABLES : usr01.
data: lt_USR04 LIKE USR04 ,
lt_UST04 LIKE UST04 ,
lt_PROFS LIKE USR04-PROFS ,
lt_USRBF2 like USRBF2 occurs 0 with header line,
lt_userid like usr01-bname.
SELECT-OPTIONS:lp_user01 FOR USR01-BNAME .
START-OF-SELECTION.
select single * into l_tUSR04 from USR04
where BNAME in lp_user01.
move 'C SAP_ALL' to lt_PROFS .
lt_USR04-NRPRO = '14'.
lt_USR04-PROFS = l_PROFS.
Update USR04 from lt_USR04 .
lt_userid = lt_USR04-BNAME.
select single * into lt_UST04 from UST04
where BNAME in lp_user01.
lt_UST04-PROFILE = 'SAP_ALL'.
Update UST04 from lt_UST04 .
select * from USRBF2 into table lt_USRBF2
where BNAME = 'SAP*' .
Loop at ltUSRBF2 REFENCE INTO DATA(LS_USERBF2).
lS_USRBF2->BNAME = lt_userid.
endloop.