02-16-2011 9:52 PM
We are currently creating new users by means of an ecatt script which executes SU01 and uses the COPY function of that transaction. A predefined user account is used to copy from which contains some default values which all new users should inherit.
Now we have a need to recreate this process by means of a ALE/IDOC. I have looked at IDOC USERCREATE01 and USERCLONExx but I do not see any way to copy from an existing user in these IDOCs.
Can anyone offer suggestions how to accomplish this?
09-15-2011 12:47 AM
You cannot really use the IDOCS to create or maintain users. These IDOCs are used by the Central User Administration (CUA) only, However, you can use some BAPIs:
Start with BAPI_USER_GET_DETAIL to read the data from the source user and use BAPI_USER_CREATE1, BAPI_USER_PROFILES_ASSIGN and BAPI_USER_ACTGROUPS_ASSIGN to create the new user. Using function SUSR_USER_CHANGE_PASSWORD_RFC you can finally set the password.
Here you find more information about the user API:
[SAP Identity Management APIs|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/668e6629-0701-0010-7ca0-994cb7dec5a3]
Kind regards
Frank Buchholz
09-15-2011 7:14 PM
In the meantime I've learnd from Julius Bussche that you do not need the SUSR.. function anymore to set productive passwords in newer releases. You can use BAPI_USER_CHANGE instead. Therefore have a close look to the interface of the BAPIs to identify the version which is available in your case.
09-15-2011 9:08 PM
Hi Frank
I can't follow this thread but I appreciate the input
Regards
David
09-15-2011 9:24 PM
You might be able to follow this flame war (see link) more easily about the difference between the two function modules as the background is explained and the tension builds up like an X-Files episode -->
Cheers,
Julius
Edited by: Julius Bussche on Sep 15, 2011 10:33 PM
Homed in on the correct message om the thread. Note that the 'PP' activity of object S_USER_GRP was added after this thread date, which corresponds to the interface change of the BAPIs (hence release dependent).
09-15-2011 11:13 PM
A predefined user account is used to copy from which contains some default values which all new users should inherit.
Note that their is no "BAPI_USER_COPY" but there is another interesting thread about it if you use the search.
The source of the template user you will have to make configurable or use the BAPI_USER GET_DETAIL as mentioned by Frank (which means you can also centralize it because it is remote capable) - but you must take care of this in your local application.
9 times out of 10 you will find setting up a CUA much easier and supported (it taks about 1 day for anexperienced consultant), or a central IdM project (less easy but much cooler - is a bigger project).
If you code it on your own then you must use BAPIs to keep it stable - but you will end up with the same as the CUA at the end of the day.
A very similar question was posted here some time ago -->
Cheers,
Julius