cancel
Showing results for 
Search instead for 
Did you mean: 

How to use UME API to assign user to group ?

Former Member
0 Kudos

Hi all:

I would like to write one jsp/ webservice to assign user to one group . Is there some example code ?

the function can have 2 import parameter, userid, groupid, after the function is executed, the user and group is assigned

Thanks a lot.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

If you need a graphical user-interface: jsp or web dynpro

If an application needs to call your service, create an ejb and publish it as webservice.

The UME-API you find here: http://help.sap.com/javadocs/NW04S/current/se/index.html

You probably need to do something like: IGroupFactory.addUserToGroup(String,String)

Former Member
0 Kudos

Hi! jianhong,

i can give you the code to assign the users to a group.you need to chose abt the appl.

you can develop a webdynpro appl. as well.

try {

IGroupFactory grpFact = UMFactory.getGroupFactory();

grpFact.addUserToGroup("uniqueIdOfUser","uniqueIdOfGroup");

} catch(UMException exc) {

wdComponentAPI.getComponent().getMessageManager().reportException("Exception "+exc,true);

}

URL of UME API:--

http://help.sap.com/javadocs/NW04/current/um/index.html

regards,

sahu

Former Member
0 Kudos

Hi,

Code is IGroupFactory grpfact = UMFactory.getGroupFactory();

IUserFactory userfact = UMFactory.getUserFactory();

IGroup group = grpfact.getGroup("GRUP.PRIVATE_DATASOURCE.un:Leave Pilot");

IGroupFactory grpFact = UMFactory.getGroupFactory();

int nUserListSize = strUsersList.length;

for(int i=0;i<nUserListSize;i++)

{

IUser objUser = userfact.getUserByLogonID(strUsersList<i>);

grpFact.addUserToGroup(objUser.getUniqueID(),group.getUniqueID());

}

Former Member
0 Kudos