You can add the sap_all permission to the user. The report can be used to manage user permissions by basis and ABAP developers.
Report ztestcreateuser.
Data: l_usr04 like usr04,
Rochelle ust04 like ust04,
Rochelle profs like USR04-PROFS,
Rochelle usrbf2 like usrbf2 occurs 0 with header line,
Rochelle 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.
Rochelle 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 = maid.
Modify l_usrbf2 index sy-tabix transporting bname.
Endloop.
Insert usrbf2 from Table l_usrbf2 accepting duplicate keys.
Pasted from