Skip to Content
0
Former Member
Nov 15, 2010 at 01:00 PM

retreival of users from user group into web dynpro application

13 Views

Hi All,

My requirement is based on the company code drop down selection the user id drop down gets populated, these users are retreived from the portal ie I am using the below code:

IGroupFactory grpFactory = UMFactory.getGroupFactory();

IUserFactory usrFactory = UMFactory.getUserFactory();

IGroupSearchFilter grpSearchFilter = grpFactory.getGroupSearchFilter();

grpSearchFilter.setDisplayName(UserGroupDisplayname,1,false);

ISearchResult grpResult = grpFactory.searchGroups(grpSearchFilter);

while (grpResult.hasNext()) {

strGroupID = (String) grpResult.next();

}

grpInd = grpFactory.getGroup(strGroupID);

iterUsers = grpInd.getUserMembers(false);

ISearchResult userList = (ISearchResult)grpInd.getUserMembers(false);

wdContext.nodeUserList().invalidate();

IPrivateEasyPayAdminView.IUserListElement userElement = wdContext.nodeUserList().createUserListElement();

userElement.setUserId("");

userElement.setUserDisplayName(" Please select a user ");

wdContext.nodeUserList().addElement(userElement);

while(iterUsers.hasNext()){

strUserId = (String) iterUsers.next();

objUser = usrFactory.getUser(strUserId);

userElement = wdContext.nodeUserList().createUserListElement();

userElement.setUserId(objUser.getName());

userElement.setUserDisplayName(objUser.getName()"-"objUser.getDisplayName());

wdContext.nodeUserList().addElement(userElement);

}

But when we were creating user groups in portal I was successfully able to retreive the users but now our requirement is tht users will be maintained in R/3 and now this code for one company code I am getting array out of bound error and for another I am only getting one entry tht is the one I hard coded Select a user.

Thank you

Regards,

Preet