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: 

Provide user role assigements in batch file (help in design )

Former Member
0 Kudos

HI All ,

I have to provide new class which can provide the user assignments to roles .

the user assignments to roles need be provided to by CSV file to on the server .

i want to run on all the users with bapi get details .

i need help in thinking on edge case .

Regards

Nina

1 ACCEPTED SOLUTION

martin_voros
Active Contributor
0 Kudos

Hi,

I would define a class with the attributes username and table of roles and the following simple methods:

static method getUser - parameter username

It would simply return a object with stored user name and all roles assigned to this user using BAPI BAPI_USER_GET_DETAIL or throw exception user does not exist.

method addRole - parameter role. This method would simply add role into list of roles.

method removeRole - parameter role. This method would simply remove role into list of roles.

method storeUser - this method would commit changes to DB using BAPI BAPI_USER_ACTGROUPS_ASSIGN and BAPI_USER_ACTGROUPS_DELETE.

After you implement this basic class you can add additional methods like getRolesFromFile which would read and parse CSV file and use methods removeRole and addRole.

Cheers

2 REPLIES 2

martin_voros
Active Contributor
0 Kudos

Hi,

I would define a class with the attributes username and table of roles and the following simple methods:

static method getUser - parameter username

It would simply return a object with stored user name and all roles assigned to this user using BAPI BAPI_USER_GET_DETAIL or throw exception user does not exist.

method addRole - parameter role. This method would simply add role into list of roles.

method removeRole - parameter role. This method would simply remove role into list of roles.

method storeUser - this method would commit changes to DB using BAPI BAPI_USER_ACTGROUPS_ASSIGN and BAPI_USER_ACTGROUPS_DELETE.

After you implement this basic class you can add additional methods like getRolesFromFile which would read and parse CSV file and use methods removeRole and addRole.

Cheers

0 Kudos

HI Martin,

Thanks

What i need is to provide service which just provide the user assignments (GET )which already exist in the BE ,

i don't need to create new roles to user .

what i need is to know how to optimize the process i.e. after the initial load (send all the user with there assignments )

i want to calculate the the deltas and not to calculate all the the users .

i think that that i can do it with time stemp which i send to the caller, and one of the problem is how to know if the user is deleted from the list or if for some user some role are deleted from is list and etc .

What do u think i want to catch the edge cases ?

Regards

Nina

Edited by: Nina C on Oct 5, 2009 9:31 AM