Skip to Content
avatar image
Former Member

Search for Portal User in Web Dynpro application

Hi all,

I have a problem with function "UserSearch" in my WebDynpro application. With following code I cannon have data user who registered with the portal.

try {

IUserFactory ufact = UMFactory.getUserFactory();

IUserSearchFilter isf = ufact.getUserSearchFilter();

// data from input field

String mySearchStr = wdContext.currentContextElement).getUserDataSelect();

//Provide the search attributes

isf.setDisplayName("" + mySearchStr + "",ISearchAttribute.LIKE_OPERATOR,false);

//Start search

ISearchResult sr = ufact.searchUsers(isf);

String strtest = sr.toString().toUpperCase();

IUser user = UMFactory.getUserFactory().getUser(strtest);

//put <b>user.getUniqueName</b>() -> in context Node

} catch (UMException e) {

e.printStackTrace();

}

Can some one give me pointers or some sample code of web dynpro which we can search specific user in the portal (Search parameters: ID, Last/First Name)

Thanks,

Natalia

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 09, 2005 at 12:33 PM

    hi natalia

    use the portal user management api by importing the portal ume api jar files

    to check for the portal user.then you can use the portal api to search the user.

    regards

    saravana

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 09, 2005 at 12:20 PM

    Hi Natalia,

    Check on to this thread u will find the solution of solving ur problem,

    how-to-get-r3-user-from-portal-user-user-mapping

    Hope tihs helps u,

    Regards,

    Nagarajan.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 09, 2005 at 12:22 PM

    hi,

    Try using the following codes

    IUserFactory iuf = UMFactory.getUserFactory();

    IUserSearchFilter usf = iuf.getUserSearchFilter();

    String search = wdContext.currentSearchElement().getSearchKey();

    search = "" + search + "";

    usf.setSearchMethod(usf.SEARCHMETHOD_OR);

    you need to include com.sap.security.api.jar file to implement.

    Also see this thread for more information

    /thread/35152 [original link is broken]

    hope it helps...

    regards,

    Arun

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Arun,

      Sorry , I am new to web dynpro and for me is not clearly how can I access to selected user date if I use the methode usf.setSearchMethod(usf.SEARCHMETHOD_OR);

      Can you sent me more details?

      What about search input parameters:is it possible to search for lastname, firstname or user id ?

      P:S: I have included com.sap.security.api.jar file in my project.

      Thanks for your help

      Natalia