Application Development and Automation 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: 
Read only

Program to Create Users in Multiple Clients at Once

Former Member
0 Likes
2,736

Hello experts.

We have a multi-client architecture and I have to frequently create users in many of them at once.

Is there a fast way or does anybody have ABAP code to create users in multiple clients by while also an existing users Roles?

We have a program to copy the users, but I still have to go into every system and assign roles. This is very tedious, so I would appreciate any help.

6 REPLIES 6
Read only

mvoros
Active Contributor
0 Likes
1,752

Hi,

there is a BAPI BAPI_USER_PROFILES_ASSIGN which can be used to assign roles to user. So you can set up RFC destinations to all required clients and then call this BAPI for all RFC destinations from "master" client .

But for this use case SAP provides CUA - Central User Administration. I think you should think about it. Try to avoid these various ABAP solutions which are not reliable, especially in case of user management.

Cheers

Read only

Former Member
0 Likes
1,752

create a RFC FM call user creation BAPI in it.

Read only

Sougata
Active Contributor
0 Likes
1,752

Hello,

You can make use of the ALE Distribution Model with the details below to automate this process.

Message type:- USERCLONE

Object type:- USER

Method:- CLONE

IDoc Type:- USERCLONE05

FM for outbound:- ALE_USER_CLONE

FM for Inbound:- IDOC_INPUT_USERCLONE

The program to trigger the Idocs is RSCCUSND but you would need to configure ALE model

(BD64 plus other WExx) transactions first before you can use the program.

Also, the users must exist in the master client from where you distribute the Idocsto other systems/clients.

Hope this helps,

Cheers,

Sougata.

Sent from my iPhone 3GS

Read only

Former Member
0 Likes
1,752

Hello Valhalla,

Try this way:

BAPI_USER_CREATE1 is remote enabled so you can create RFC destination for the all the system

you want to create users.

Load all the rfc destination in one table.

Load all the users need to be created in one table.

Loop at rfc_dest_tab.

loop at users_tab.

CALL FUNCTION 'BAPI_USER_CREATE1' DESTINATION rfc_dest_tab-RFC_DESTINATION

EXPORTING

USERNAME = users_tab-USERNAME

  • NAME_IN =

LOGONDATA =

PASSWORD =

  • DEFAULTS =

ADDRESS =

  • COMPANY =

  • SNC =

  • REF_USER =

  • ALIAS =

  • EX_ADDRESS =

  • UCLASS =

  • TABLES

  • PARAMETER =

  • RETURN =

  • ADDTEL =

  • ADDFAX =

  • ADDTTX =

  • ADDTLX =

  • ADDSMTP =

  • ADDRML =

  • ADDX400 =

  • ADDRFC =

  • ADDPRT =

  • ADDSSF =

  • ADDURI =

  • ADDPAG =

  • ADDCOMREM =

  • GROUPS =

  • PARAMETER1 =

  • EXTIDHEAD =

  • EXTIDPART = .

ENDLOOP.

ENDLOOP.

This will create required user in remote SAP systems.

Hope this solves your issue!

Thanks,

Augustin.

Edited by: Augustarian on Aug 22, 2009 11:52 AM

Edited by: Augustarian on Aug 22, 2009 11:52 AM

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,752

Hello

For this purpose SAP has developed the CUA - Central User Administration.

You have a single central CUA system and all other systems (and clients) are child system of the CUA.

You create the user in the CUA and assign as many logical systems (= child CUA systems) as required and then you can distribute the user simultaneously.

The role assignments should be distributed as well yet requires that the roles are present in the target system(s).

Regards

Uwe

Read only

Former Member
0 Likes
1,752

hii,

Each client of an ABAP system is considered a separate (logical) system - with its own user management. Such cross-client operations (as wanted by you) are not desired - and therefore not supported.

The (ABAP) Central User Administration (CUA) as well as the SAP NetWeaver Identity Management (IDM) solution allow to perform user administrative tasks in a system landscape (for CUA: only ABAP systems).

you can refer to this link also,hope this would be helpful.

rgrds,

shweta