on 01-16-2008 1:56 PM
i try to count the amount of users that
the company = "SAPerClub"
and i don't get result (the result is 0)
i have the script
if somone can help me and tell me what's the problem
try {
IUserFactory userFact = UMFactory.getUserFactory();
IUserSearchFilter userFilt = userFact.getUserSearchFilter();
userFilt.setCompany("SAPerClub", ISearchAttribute.LIKE_OPERATOR,false);
ISearchResult result = userFact.searchUsers(userFilt);
if (result.getState() == ISearchResult.SEARCH_RESULT_OK) {
while (result.hasNext()) {
String uniqId = (String) result.next();
IUser thisUser = userFact.getUser(uniqId);
String company = thisUser.getCompany();
}
}
else {
// print error or warning
}
wdContext.currentContextElement().setCountusers(result.size());
} catch (UMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
10x
yossi
There are different codes of search process [Search Result States|http://help.sap.com/javadocs/NW04S/current/se/com/sap/security/api/ISearchResult.html]. What is the state after execution this piece of code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yossi
What does the the line result.getState() return in the case where your result is 0?
Br
Göran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.