Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Copy user documentation in su01 programmatically to another user

former_member2492
Active Participant

Hi All,pretty simple how to copy it to another user.

let me know for any Function Modules

1 ACCEPTED SOLUTION

former_member2492
Active Participant

"get the data from the User that we want.

 select single *
 from usdocu
 where bname eq @previous_username
 into @data(ls_docu).


 append ls_docu to lt_docu.


 loop at lt_docu assigning <lf_docu>.
 <lf_docu>-bname = lv_new_username.
 endloop.


 call function 'SUID_IDENTITY_SAVE_TO_DB'
 exporting
 it_usdocu_insert = lt_docu
 is_timestamp = ls_timestamp.
6 REPLIES 6

GK817
Active Contributor
0 Kudos

Hi,

Please check the FMs in function group SU_USER. Copying the user may not be possible with one FM. You can use FMs to read the user and then pass the values to create user FM. It should help to achieve what you want to.

Regards

GK

0 Kudos

please tell me which FM reads documentation of the user

VeselinaPeykova
Active Contributor

A quick search in Google with terms sap su01 documentation points to a lot of results and the first in the list is SU01 - Documentation Tab - Documentation for User. It has an accepted answer and the links to SAP help look quite promising (I cannot test the solution at the moment).

Did you already try that?

0 Kudos

can you please let me know which method of that class reads the docuementation of the user?or sets it?

Simply follow the link which I provided and read the accepted answer.

I have no access to a system where the class mentioned in the official documentation is available so I cannot tell you whether these methods are suitable for your use case, you need to do this yourself.

former_member2492
Active Participant

"get the data from the User that we want.

 select single *
 from usdocu
 where bname eq @previous_username
 into @data(ls_docu).


 append ls_docu to lt_docu.


 loop at lt_docu assigning <lf_docu>.
 <lf_docu>-bname = lv_new_username.
 endloop.


 call function 'SUID_IDENTITY_SAVE_TO_DB'
 exporting
 it_usdocu_insert = lt_docu
 is_timestamp = ls_timestamp.