Skip to Content
avatar image
Former Member

Function module to get the roles assigned to user

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 22, 2009 at 03:32 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 22, 2009 at 04:54 AM

    Use this FM.

    CKEXUTIL_USER_TO_ROLE

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 22, 2009 at 03:46 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 22, 2009 at 04:00 AM

    Hi,

    Try:

    RSRA_USERS_OF_AGR_GET

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

    Thanks,

    Krishna

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 22, 2009 at 04:02 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 22, 2009 at 06:36 AM

    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

    Add comment
    10|10000 characters needed characters exceeded