Skip to Content
avatar image
Former Member

Checking Existing Portal User

Hi all,

I am new to Web Dynpro Java. Can anyone help me how to check if the user is existing user?

Regards,

Nithya M

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Feb 09, 2009 at 12:20 PM

    use this

    IWDClientUser currentUsers[]=WDClientUser.getClientUsers();

    //Displaying the count of logged on users

    wdComponentAPI.getMessageManager().reportSuccess("Number of logged on Users in the portal - "+(currentUsers.length-1));

    for(int i=0;i<currentUsers.length;i++){

    if(currentUsers<i>!=null){

    // Displaying the logged on users;

    if(!currentUsers<i>.getLastName().equals("Guest")){

    String first= currentUsers<i>.getFirstName();

    wdComponentAPI.getMessageManager().reportSuccess("User - "currentUsers<i>.getFirstName()" "+currentUsers<i>.getLastName());

    }

    }

    }

    add the com.sap.securtiy_2.00.jar file into java build path.....by right click your project-java build pathadd variablesjava runtimeexpend--com.sap.securtiy_2.00.jar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 10, 2009 at 09:17 AM

    Hi,

    Go through this code,

    try {

    IWDClientUser clientUser = WDClientUser.getCurrentUser();

    clientUser1.getClientUserID());

    clientUser1.getDescription());

    clientUser1.getFirstName());

    clientUser1.getLastName());

    clientUser1.getSalutation());

    clientUser1.getServiceName());

    clientUser1.getTitle());

    clientUser1.getVersion());

    clientUser1.getClass());

    clientUser1.getVersion());

    clientUser.isAnonymouseUser());

    }

    catch (WDUMException e)

    {

    wdComponentAPI.getMessageManager().reportException( e.getMessage(), true);

    e.printStackTrace();

    }

    Regards

    Padma N

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 10, 2009 at 09:02 PM

    Hi Nithya,

    With the following code you can check if a user is present in the backend.

    IWDClientUser clientUser = WDClientUser.getCurrentUser();
    IUser user = clientUser.getSAPUser();
    //This will throw a NoSuchUserException exception if the user in not there.
    IUser newUser = user.getUserByLogonID("userID");
    //IUser interface has lot of methods to check users in SAP system

    .

    You can also go through [this|create-portal-user-using-ume-apis; post where a user is being created using code. There are api's there with which you can search for users.

    Regards,

    Sanyev

    Add comment
    10|10000 characters needed characters exceeded