cancel
Showing results for 
Search instead for 
Did you mean: 

retreival of users from user group into web dynpro application

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I believe, there exists some standard function module to retrieve the User list maintained in R/3

Please check the function module to get the user list - SO_USER_LIST_READ

Regards,

Saravanan K

former_member185879
Active Contributor
0 Kudos

Hello Preet,

Based on company code you need users in the second dropdown, if it is coming from R/3 then you have a RFC which will get the company code and exports the user in the table, bind the table to the drop down by index.

On changing the company code you need to call the RFC, so that users will get change.

I hope it clears your query.

Regards

Nizamudeen SM