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

Function module to get the roles assigned to user

Former Member
22,587

Hi to all experts,

I need a fm to retrieve the roles assigned to user .

if a pass sy-uname as importing parameter i should to get all the roles assigned to that particular user

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
8,356

Hi, <li>Check the table AGR_USERS to get users assigned to a given role. Thanks Venkat.O

Hi to all experts,

I need a fm to retrieve the roles assigned to user .

if a pass sy-uname as importing parameter i should to get all the roles assigned to that particular user

6 REPLIES 6
Read only

venkat_o
Active Contributor
8,357

Hi, <li>Check the table AGR_USERS to get users assigned to a given role. Thanks Venkat.O

Read only

former_member156446
Active Contributor
8,356

Check [this discussion|http://sap.ittoolbox.com/groups/technical-functional/sap-security/sap-users-access-to-transactions-1933771]

Read only

Former Member
0 Likes
8,356

Hi,

Try:

RSRA_USERS_OF_AGR_GET

or use table AGR_USERS to get users assigned to a given role

Thanks,

Krishna

Read only

Former Member
0 Likes
8,356

Hi mohammed,

Below select query is used to get the roles assigned to the user.

SELECT agr_name FROM agr_users APPENDING TABLE lt_role_in
        WHERE uname    eq <uname>
          AND from_dat <= sy-datum
          AND to_dat   >= sy-datum
          AND exclude  EQ space .

all the very best.

Sreenivasa sarma K.

Read only

GauthamV
Active Contributor
8,356

Use this FM.

CKEXUTIL_USER_TO_ROLE

Read only

Former Member
0 Likes
8,356

hai,

please try this.

/VIRSA/RE_BAPI_CREATE_ROLE- Create Roles

/VIRSA/ROLE_ASSIGN_CUA_NH

/VIRSA/RE_BAPI_ROLE_TO_USERS

ASSIGN_USERS_HIERARCHY - User Assignment to Role - this is a Normal FM

try this bapis this may work

BAPI_USER_LOCK

- BAPI_USER_PROFILES_ASSIGN

- BAPI_USER_LOCPROFILES_ASSIGN

- BAPI_USER_LOCACTGROUPS_ASSIGN

- BAPI_USER_CHANGE

- BAPI_USER_UNLOCK