IUser and IuserAcount

i'm using with the class IUserSearchFilter to search users
by criteria like Company, LastName etc
example:
IUserSearchFilter userFilt = userFact.getUserSearchFilter();
userFilt.setCompany("SAPerClub", ISearchAttribute.LIKE_OPERATOR,false);
my question is:
i want search users by criteria Creation Date
but the method setCreationDate is in iUserAcountSearchFilter
what can i do
if i want to search user By Company and SetCreateBetween
10x
Yossi

Hi
Can't you just call the method searchUsers(IUserSearchFilter ufilter, IUserAccountSearchFilter uafilter) which will do the following:
"Search for users in the user store and user account store which match the criteria specified in the given ufilter and uafilter and combine the result."
I copied this from the IUserFactory class for NW 2004s. Is that api existing for you?
Br
Göran

Similar Messages

  • Error while getting the Direct parent group from IUser

    Dear all,
    I'm using KM API's to upload documents to KM through a Webdynpro Application.
    The uploading of the document is working correctly.  the permission setting to the newly uploaded document is done based on user group in which the user is a member.
    This is also working.
    While uploading, the  user gets a selection screen to choose the area.
    If the user is a member of All India that person will get option to select all branches and all areas under each branch.
    If the user is a member of any one branch, he can select only areas coming under his branch.
    Here the problem starts. (All India is the parent group for all branches,  under branch some areas are there.)
    User 1 is a member of All India
    User 2 is a member of Branch1
    If an All India user comes in we give the branch list in a dropdown list. Branch user should not get this dropdown. He's not supposed to upload documents for any other branch.
    I am checking the parent group of the user identify his Level. But even if the user is not a member of All India, I'm getting the dropdown to choose the branch.
    Please give me your valuable guidance to solve this.
    My code for getting the parent group is given below.
    public com.sapportals.portal.security.usermanagement.IGroup getParentGroup( com.sapportals.portal.security.usermanagement.IUser ep5User )
        //@@begin getParentGroup()
            String [] parentGrp=null;
            IGroup parentGroup=null;
            try
                 IGroupFactory groupFact=WPUMFactory.getGroupFactory();
                 /* Get all the User groups in which the user is a member */
                 String [] userGroup=ep5User.getDirectParentGroups();
                 for(int i=0;i<userGroup.length;i++)
                      IGroup userGrp=groupFact.getGroup(userGroup<i>);
                      if(userGrp.getId().startsWith("B00") || userGrp.getId().equalsIgnoreCase("ALL_INDIA"))
                           msgMngr.reportSuccess("ID of the group "+userGrp.getId());
                           parentGroup=userGrp;
                           break;     
            catch(UserManagementException e){
                 msgMngr.reportException("UserManagementException"+e,false);
            return parentGroup;
        //@@end
    Best Regards,
    Aparnna

    I found a solution. Not sure if its the correct one.
    Used the com.sap.security.api.IUser and used the below code to check if the user is a member in group
    IUser user=WDClientUser.getCurrentUser().getSAPUser();
                   com.sap.security.api.IGroup grp=UMFactory.getGroupFactory().getGroupByUniqueName("ALL_INDIA");
                   if(grp.isGroupMember(user.getUniqueID(),false))
    //code to be executed if the user is a member
    Best Regards
    Aparnna

  • How to get current IUser (com.sapportals.portal.security.usermanagement)

    Hi,
    does anybody know how to get IUser for the current user?
    I know how to get current IUser from com.sap.security.api package:
    IWDClientUser wdcu = WDClientUser.getCurrentUser();
    IUser sapUser = wdcu.getSAPUser();
    but I need to have IUser from com.sapportals.portal.security.usermanagement package.
    Regards,
    Ladislav

    Ladislav,
    Try this:
    Get the IUser uisng the API com.sap.security.api.IUser and store it in a variable, say <i>sapUser</i>.
    Then,
    // Convert the logged in user to old EP5 usermanagement API
    com.sapportals.portal.security.usermanagement.IUser user = null;
    try
         com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getEP5User(sapUser);
    catch (UserManagementException e)
         e.printStackTrace();
    Bala

  • List all users and other information into application

    Hi,
    In the LDAP that we use, it contains - user id and xyz_code (this code is particular to application). Note that for each user_id there exists one xyz_code.
    I can get the user id from IUser and xyz_code from an attribute app_xyz_code.
    String xyzCode = sapume.getValue("app_xyz_code",iuser, true);
    I have a requirement where I need to get user ids for a set of xyz_codes.
    1) Suppose I have 100 xyz_codes I need to get 100 users from LDAP. So 100 times I need to hit LDAP. How do i make a search in LDAP using xyz_code. Is it preferrable to make a search like this?
    2) Another thing I want to know is if it is possible to get all the users and their corresponding xyz_codes from LDAP and store them in a List/Vector/Enumeration. So that I can search in the list for user id corresponding to xyz_code.
    Any code snippets is appreciated.
    Thank you
    Karthika

    Thanks for your reply!
    I tried the following:
    $Users = get-aduser -SearchBase 'OU=Mes Utilisateurs,DC=itced,DC=lan' -filter '*'
    $OU = $User.distinguishedname -split ',',2 | select -last 1
    $output = @()
    Foreach($User in $Users){
    $budgetanalytics = Get-ADOrganizationalUnit -SearchBase $OU -Properties objectGUID
    $Object = New-Object PSObject                                       
    $Object | add-member Noteproperty user $user.name         
    $Object | add-member Noteproperty OU $OU                       
    $Object | add-member Noteproperty objectGUID $objectGUID       
    $output += $Object
    $output
    but I get the following
    user                                             
    OU                                              
    objectGUID                                      
    User1                                            
    OU=Mon OU,OU=Mes Utilisateurs,DC=itced,DC=lan    {Microsoft.PowerShell.Commands.Internal.Forma...
    User2                                            
    OU=Mon OU,OU=Mes Utilisateurs,DC=itced,DC=lan    {Microsoft.PowerShell.Commands.Internal.Forma...
    Why do I get "Microsoft.PowerShell.Commands.Internal.Forma..." instead of the actual objectGUID of the Organizational Unit
    Thanking you in advance

  • Problem with addition of jar file to DC

    Hi WDers,
    I have a DC of type WD.
    I'm trying to add com.sap.security.api.jar file to this component so that I can get IUser and work on it.
    I have added this security jar file as an External jar file to the DC. But whenever I try to DC->Build, the jar entry is going away. So the Build is failing.
    Can you kindly let me know why this is happening?
    Or is there any other way to add a jar file so that I can use the IUser interface in my view?
    Thanks in Advance
    RK

    Hello,
    Add the Standard DC "com.sap.security.api.sda" from the SAP-JEE. This ahould solve the problem.
    To do that follow the steps:
    1. Go to the "DC Metadata" option available under the DC.
    2. Go to "Used DCs" and choose "Add used DCs" from the context menu which appears on a right click at the Used Dcs option.
    3.Select "com.sap.security.api.sda" under SAP-JEE and choose finish.
    4. Build the DC to gain access to the IUser and other related classes.
    Bala.

  • Can I create enterprise aliases disabled by default?

    On another thread I asked How do I create and new enterprise alias?
    I was directed to the following SAP Note...
    http://service.sap.com/sap/support/notes/1804839
    I was able get things working and create enterprise aliases for all of my Windows AD users that don't already have one.  The reason I am doing this is so that when they get removed from the active directory group and subsequently BusinessObjects their corresponding inbox, personal folder and any schedules they may have created do not get removed.
    So my question is this.  Is there any way to create an enterprise alias disabled by default?  Here is the code snippet downloaded from the aforementioned note.
    I would like to add a line after user.setNewPassword (line #91) that says something like this...
    user.setEnabled(false);
    However, that isn't working.  The method setEnabled is not recogized.  I did check the documentation for IUser and cannot find any method to disable an enterprise user.  Does such a method exist?
    Thanks,
    Noel

    You can't do this directly on the IUser object - it has to be done on an IUserAlias object.  So, your code might look something like this:
    IUserAliases uAliases = user.getAliases();
    for (Object aobj : uAliases){
        IUserAlias alias = (IUserAlias) aobj;
        if (alias.getType() == IUserAlias.ENTERPRISE){
            alias.setDisabled(disable);
    -Dell

  • Getting portal roles in web dynpro

    Hello
    I'm sure this is a common problem but I've checked all the older posts and I just can't get it working.
    We have a web dynpro app that runs within an EP iView (EP6SP14), and we need to retrieve the <i>portal</i> roles for the user.
    With the APIs (using IRole and IUser and the getRoles() method) we only get the J2EE roles.  These are not the same.
    Can anyone help?
    Thanks
    Chris

    Hi
    Thanks for the response.  Unfortunately, we have already tried a similar approach.  See our code below.  It sees to pull the WAS J2EE roles, but not the PCD roles.
    public void getPortalUserDetails( )
                IWDMessageManager messageManager =
                      this.wdThis.wdGetAPI().getComponent().getMessageManager();
                PortalIntegrator portalIntegrator = null;
                new PortalIntegrator(this.wdThis.wdGetAPI());
                WDClientUser.forceLoggedInClientUser();
                if (WDPortalUtils.isRunningInPortal()) {
                      try {
                            IWDClientUser currentUser = WDClientUser.getCurrentUser();
                            IUser sapCurrentUser = currentUser.getSAPUser();
                            sapUser = sapCurrentUser;
                            String userId = currentUser.getClientUserID();
                            // Get the SAP Current User  
                            if (sapCurrentUser != null) {
                                 portalUserId = sapCurrentUser.getUniqueName();
      public boolean isManager( )
                String roleName = null;
                boolean correct = false;
                try {
                      if (sapUser != null) {
                            Iterator rit = null;
                            rit = sapUser.getRoles(true);
                            IRoleFactory rfact = UMFactory.getRoleFactory();
                            while (rit.hasNext()) {
                                 roleName = (String) rit.next();
                                 IRole role = rfact.getRole(roleName);               
                            wdComponentAPI.getMessageManager().reportSuccess(
                                 "rolename: " + roleName);
                            correct = sapUser.isMemberOfRole(roleName, true);
                } catch (Exception e) {
                      correct = false;
                      Logger.error(e.toString());
                      return correct;
    //     return true;

  • E-mail functions for Custom Extensions

    Hello,
    Is there a way to use the e-mail functions that P4P uses, including reading the config file, in a Custom Extension?
    Thanks, in advance.

    you can use something like the following
    //If you want to get the current user's email (as the From):
    var currentUser = userService.UserContext.User.ContainedUser as IUser;
    string from = currentUser.email;
    // To get the email info of the originator from a spec, access the SpecSummary's Originator property, which is an IUser, and then get the email property of the user.
    string to = <yourSpec>.SpecSummary.Originator.email;
    string subject = "...";
      EmailService().SendMessage(from , to, subject, body);
    private static IUserService GetUserService()
                return AppPlatformHelper.ServiceManager.GetServiceByType<IUserService>();          
    private static IEmailService EmailService()
           return AppPlatformHelper.ServiceManager.GetServiceByType<IEmailService>();          

  • About assigning users to role

    Hi all.
    Could I assign users to a role by web dynpro callable object?
    I mean , there is a inputfield in web dynpro view,if I enter a name ,will call some methods to assign the name to a role.

    Hi
    Ya it is possible through IRole and IUser API, take help form following thread and code
    1.[GP|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e3f07a7a-0601-0010-ebbd-b9cfb445b814]
    2.[example how to Call to IUSer and IRole|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0957cb6-5103-2a10-6d9d-a0a4d68c8bf1]
    3. In second thread the user data is populated here you have to put your code
              example IRole  role;
                         role.addUserMember(arg0)
                            role.removeUserMember(arg0)
    Hope you will come to the solution.
    Best Regards
    Satish Kumar

  • Last modified by for a user/group object

    Hi All,
    Is there any way to find out who has last modified the User/Group object in the portal.
    I can see the last account unlocked by for the user object. But is there any attribute to find out who has last modified the assigned groups/users for the user/group respectively or any change in the user/group profile.
    Thanks in advance,
    Siva
    Pts will be rewarded for useful answer.

    Hi Siva,
    as far as I know there is no standard way to find out who modified a user/group object in the portal. But I just checked the official API of <a href="https://help.sap.com/javadocs/NW04S/current/se/com/sap/security/api/IUser.html">IUser</a> (represents a portal user) and <a href="https://help.sap.com/javadocs/NW04S/current/se/com/sap/security/api/IGroup.html">IGroup</a> (represents a portal user group) and found out something interesting. <a href="https://help.sap.com/javadocs/NW04S/current/se/com/sap/security/api/IPrincipal.html">IPrinciple</a> (super object of IUser and IGroup) has a field LAST_MODIFIED_BY.
    Looks like you can write your own portal component, which allows you to find out who has modified your users last.
    Best regards,
    Martin

  • Accessing Km document in webdynpro application

    Hi All,
    Is it possible to access the file which is uploaded in KM through webdynpro code?
    Can anybody help in this?
    Regards,
    V Karthi

    Thank you anagha for the link.
    But i'm facing some issue with the code .i think there is a problem in typecasting the Iuser and moreover whn i try to print the sap user i'm getting the following error.
    "sapUser Transient data: *************************************************************************** * com.sap.security.core.persistence.imp.PrincipalDatabag Tue Jun 23 10:13:29 GMT05:30 2009 * UniqueID: USER.R3_DATASOURCE.J2EE_GUEST * Type: USER * Home data source: R3_DATASOURCE * Private id part: J2EE_GUEST * * Existence not checked. * * "com.sap.security.core.usermanagement"|->"j_authscheme" (no time limit)="anonymous" *************************************************************************** Persistent data: *************************************************************************** * com.sap.security.core.persistence.imp.PrincipalDatabag Tue Jun 23 10:13:29 GMT05:30 2009 * UniqueID: USER.R3_DATASOURCE.J2EE_GUEST * Type: USER * Home data source: R3_DATASOURCE * Private id part: J2EE_GUEST * * Principal exists. * * Direct parents: * GRUP: GRUP.SUPER_GROUPS_DATASOURCE.EVERYONE *       GRUP.R3_ROLE_DS.SAP_J2EE_GUEST *       GRUP.SUPER_GROUPS_DATASOURCE.Anonymous Users * ROLE: * "com.sap.portal.dsm"|->"DebugControlFlag" (no time limit)= * "com.sap.security.core.usermanagement"|->"mobile" (no time limit)= * "com.sap.security.core.usermanagement"|->"uniquename" (no time limit)="J2EE_GUEST" * "com.sap.security.core.usermanagement"|->"title" (no time limit)= * "com.sap.security.core.usermanagement"|->"telephone" (no time limit)= * "com.sap.security.core.usermanagement"|->"salutation" (no time limit)= * "com.sap.security.core.usermanagement"|->"jobtitle" (no time limit)= * "com.sap.security.core.usermanagement"|->"fax" (no time limit)= * "com.sap.security.core.usermanagement"|->"department" (no time limit)= * "com.sap.security.core.usermanagement"|->"lastname" (no time limit)="J2EE_GUEST" * "com.sap.security.core.usermanagement"|->"locale" (no time limit)= * "com.sap.security.core.usermanagement"|->"timezone" (no time limit)= * "com.sap.security.core.usermanagement"|->"firstname" (no time limit)= * "com.sap.security.core.usermanagement"|->"email" (no time limit)= * "com.sap.security.core.usermanagement"|->"referenceuser" (no time limit)= * "$serviceUser$"|->"SERVICEUSER_ATTRIBUTE" (no time limit)= * "com.sapportals.portal.navigation"|->"uipmode" (no time limit)= *************************************************************************** ep5User WPUser default_namespace: com.sap.security.core.usermanagement [email protected]f WPUser: (J2EE_GUEST)[[email protected]271] UME user object Transient data: *************************************************************************** * com.sap.security.core.persistence.imp.PrincipalDatabag Tue Jun 23 10:13:29 GMT+05:30 2009 * UniqueID: USER.R3_DATASOURCE.J2EE_GUEST * Type: USER * Home data source: R3_DATASOURCE * Private id part: J2EE_GUEST * * Existence not checked. * * "com.sap.security.core.usermanagement"|->"j_authscheme" (no time limit)="anonymous" "
    Can you please provide me the sample code for accessing the KM document through webdynpro?
    Regards,
    V Karthi

  • Whats wrong with this servlet code..?no error in log

    hello guys..hope one of you can help....
    i have 2 servlet classes. one receives form data sent from a jsp page, then create a form object containing all the inputs.. that object is then added to the session ..
    also, it construct a User object containing info about the present user and add it to the session.. IUser and Form are inner to the main class.
    the first servlet (check) seems to work fine.. but the problem occurs with the second servlet...i have inserted some printl statements to help me identify how far it goes and it seems that the whole code of the second servlet(update) is almost redundant....I dont get any error message ..simply a blank page which is of course of no help to me...
    I hate inserting long code here but i would be pleased if anyone could tell me of a way to find out about the actual problem..program compiles fine but..it just freezes at runtime
    ..here is part of the code..whats wrong?
    HttpSession session=request.getSession();
         User user2=(User)session.getAttribute("person");
         Form fr=(Form)session.getAttribute("form");
         System.out.println("User and Form created");
         int uid=user2.getId(); //class User contain the getId method
         String uname=user2.getName();
         System.out.println("Data for user retrieved");
         String goTo=fr.getC();
         String password = fr.getP();
    String email=fr.getE();
    String newName=fr.getN();
    System.out.println("data from form retrieved");
    thanks

    the first servlet was indeed supposed to ass all those attributes...
    but the thing is that the data being retrieved later were not of the type expected...
    i have now decided to proceed differently but I am a bit curious to lean more about something that you mentionned in relation to servlet listeners..i never thought of the need to remove all those attribute when the session times out...
    I thought that it was doned automatically with a call to session.invalidate().
    is that not the case?
    thanks

  • Retrieving EP roles from web dynpro

    Hello
    I'm sure this is a common problem but I've checked all the older posts and I just can't get it working.
    We have a web dynpro app that runs within an EP iView (EP6SP14), and we need to retrieve the portal roles for the user.
    With the APIs (using IRole and IUser and the getRoles() method) we only get the J2EE roles. These are not the same.
    Can anyone help?
    Thanks
    Chris

    Hi Chris,
    have you tried to read the groups of your user? As far as i know, the roles from EP are mapped to the groups in J2EE.
    Try something like this:
    IWDClientUser user = WDClientUser.getCurrentUser();
    Iterator groups = user.getSAPUser().getParentGroups(false);
    while (groups.hasNext()) {
      String bez = UMFactory.getGroupFactory().getGroup((String) groups.next()).getDisplayName();
      // bez contains your roles (groups)
    i hope that helps
    regards
    ingo

  • User attributes for LDAP

    Hi guys,
    Currently we have an error for LDAP attribute .
    distinguishedName = (String) user.getTransientAttribute("ldap.distinguished_name");
    user is of type IUser.
    and it return null
    where could i find the list of user attributes in LDAP? currently we have LDAP 8.8.1.

    Don,
    you might should have a look at a LDAP Browser (eg. http://www-unix.mcs.anl.gov/~gawor/ldap/ ) which helps a lot to find out how the structure of your LDAP server is and which attributes you can access.
    1) Start the tool
    2) click onto the "Quick Connect"
    3) enter you LDAP server
    4) press "Fetch DNs"
    5) Uncheck "Anonymous bind"
    6) Enter your user credentials
    7) Browse your LDAP structure
    It helped me a lot to get the correct settings for the DBMS_LDAP calls.
    Patrick
    My APEX Blog: http://www.inside-oracle-apex.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://apexplugin.sourceforge.net/ New!

  • KM - Java iView - User Authentication

    Hello all,
    I'm writing a simple KM iView in Java for EP6.0.
    I want to experiment with resources; accessing, creating etc.
    I use the following code to create my IUser and access the resource context
    IUser user = userFactory.getUser(request.getUser().getUniqueName());
    IResourceContext resourceContext = new ResourceContext(user);
    If I access the resource "/", everything is fine, it gets found and I can display it's children, one of them being "/documents". When I try to access this resource I cannot because "User is not authenticated". I cannot access any other collections for the same reason. I can access a file I've created underneath "/documents", my iView displays that the file was 'found' but I cannot work with the file (e.g. display its content type) because "User is not authenticated".
    So how does a user become authenticated? Is this a user mapping issue, something that can be resolved by the portals user administrator, something I can do in Java, or something completely different?
    As always, any help is greatly appreciated.
    Thanks for your time,
    Patrick.

    Hey Armin,
    Thanks for that, it worked a treat.
    I had taken example code from the PDK where creating the IUser was written as
    IUser user = .....
    I guess they thought that it was so simple they didn't need to write it. I knew that I could access the portal user from the request and then I looked at the API there to see if any methods returned an IUser, that's why I was using getUniqueName(). It seemed to make sense.
    One question though, I see that the method for creating the user that you gave me has been deprecated. Has the new method been released or is it on its way, do you know?
    Thanks again for the solution. I awarded you the points.
    Patrick.

Maybe you are looking for