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: 

FM to add a role to a user.

Former Member
0 Kudos

is there any function module where i can add a role to a user??

i have been trying with several with no success.

If not, can i define it when i create the user with BAPI_USER_CREATE1??

Thank you all.

Artur.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

In transaction BAPI the FM BAPI_USER_ACTGROUP_ASSIGN is well documented.

No hack

Cheers,

Julius

8 REPLIES 8

Former Member
0 Kudos

Sorry if i sound naive on this,but what is the objective? why do you need a FM to add a role to the user?You could add it in SU01, roles tab or in PFCG users tab and then do a role comparison - isnt it?

Are you trying to use a program for the user creation? and once you have the user created, you want to use a FM for assigning a predefined set or roles? - is this what you are looking at?

0 Kudos

Hey,

are you trying to find a loophole? breach security? apart from that i dont find any reason why you wanna assign roles using FM,

may be you need to justify..and if you find a FM like tht please do let me know

Thanks,

Vijay

0 Kudos

Yes, it's just like Shekar.J says, I don't want to find a security breach or something like this

I want a mass creation of users.

First i create users with BAPI_USER_CREATE1.

Then i want to assign them their roles. The problem is that it is a solution manager system and for this reason i have to assign a system at the same time that i assign the role.

Thanks,

Artur.

Former Member
0 Kudos

In transaction BAPI the FM BAPI_USER_ACTGROUP_ASSIGN is well documented.

No hack

Cheers,

Julius

0 Kudos

There is also it's sibling BAPI_USER_LOCACTGROUPS_ASSIGN if you are using CUA

0 Kudos

I also forgot that you can assign a role or profile with BAPI_USER_CREATE itself as well - via a reference user for the authorization check.

Lots of options...

Cheers,

Julius

mvoros
Active Contributor
0 Kudos

Hi,

you already got answer for your question. I just want to add a link to [API for identity management|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/668e6629-0701-0010-7ca0-994cb7dec5a3]. It is one of the best documented APIs I've ever seen from SAP.

Cheers

Former Member
0 Kudos

Yes, the IdM documentation is "unpeckable" and release dependently up-to-date, so be carefull of links...

Best in class at it's source and should be a benchmark for the rest of SAP!

Cheers,

Julius