on 07-06-2008 6:24 PM
Hello expert,
In my WebDynpro application, I need to retrieve all users details that belong to specific group.
Thanks for any help you can provide.
Gil
Hi,
You can use the following code to get the Users belonging to a particular Group
try {
IUserFactory myUF = UMFactory.getUserFactory();
IGroup grp = UMFactory.getGroupFactory().getGroupByUniqueName("groupName");
Iterator userMembers = grp.getUserMembers(true);
while (userMembers.hasNext()) {
String userID = (String) userMembers.next();
IUser myUser = myUF.getUser(userID);
//Get the details frommyUser
//myUser.getDisplayName();
}
} catch (Exception ex) {
//catch exception
}
Thanks & Regards,
Jhansi Miryala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for your help, it was very helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this code to get all users
try{
IUserFactory uf = UMFactory.getUserFactory();
ISearchResult ids = uf.getUniqueIDs();
while (ids.hasNext()) {
String uid = (String) ids.next();
IUser sapUser = uf.getUser(uid);
if (sapUser.getUserAccounts()[0] != null) {
wdComponentAPI.getMessageManager().reportSuccess("Logon UID: " + sapUser.getUserAccounts()[0].getLogonUid());
}
}
}catch(Exception e){
e.printStackTrace();
}
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.