cancel
Showing results for 
Search instead for 
Did you mean: 

How to search users by created date????

Former Member
0 Kudos

Hi forum

I want to search users by created date. I mean that i´m consulting users that was creating in dd/mm/yyyy date.

Someone knows how use the IUSearchFilter to make this ?

Thnks

Joshua

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Why don`t You do like this:


Date date1 = new Date();
Date date2 = new Date();
IUserAccountFactory  userAccFactory = UMFactory.getUserAccountFactory();
IUserAccountSearchFilter filter = userAccFactory.getUserAccountSearchFilter();
filter.setCreateBetween(date1,date2);
ISearchResult result = userAccFactory.search(filter);

Now You can iterate over result, in addition You need to initialize varaibles

date1 and date2 with proper values;

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi! Josue,

i think this code may help you...

IGroupFactory grpFact = UMFactory.getGroupFactory();

IGroupSearchFilter searchFilt = grpFact.getGroupSearchFilter();

searchFilt.setUniqueName("*",ISearchAttribute.LIKE_OPERATOR, true);

ISearchResult srchRslt = grpFact.searchGroups(searchFilt);

while(srchRslt.hasNext()) {

String uniqueID = (String)srchRslt.next();

IGroup thisGrp = grpFact.getGroup(uniqueID);

String name = thisGrp.getDisplayName();

}

}

The code is self explanatory..

If you have any query feel free to ask?

regards,

Mithileshwar

Former Member
0 Kudos

Hi Mithileshwar,

And what about the search filter by creation date of the user ?

Thnks

Josue

Former Member
0 Kudos

Hi! Josue,

Use the following link for UME API, i think the getValidFromDate() method of IUserAccount may help you.

<a href="http://help.sap.com/javadocs/NW04/current/um/index.html">http://help.sap.com/javadocs/NW04/current/um/index.html</a>

regards,

Mithileshwar

Former Member
0 Kudos

Please use IUserAccountSearchFilter, there You have setCreateBetween method.