Skip to Content
author's profile photo
Former Member

Wrong Username on getR3User call

I have an application where I have to find the current portal username so I can load the correct data. It works fine until I log out and then log in as another user. The web dynpro application retrieves and uses the old username. It appears that is it uses the userid of the person who logged in before. Below is my code:

String strUser= "" ;

//Get and set username

IWDClientUser user1 = WDClientUser.forceLoggedInClientUser();

IUser user2 = user1.getSAPUser();

IUserMapping test = UMFactory.getUserMapping();

try {

String name = test.getR3UserName (user2,"SAPLOGONTICKET",null,true);

strUser = name;

}

catch (UMException e) {

wdComponentAPI.getMessageManager().reportSuccess("Error: " + e.getMessage());

}

I've read the WDClientUser documentation, but would appreciate any further insight into is inner working. I need to get around this issue.

Thanks,

Tom

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Oct 07, 2005 at 05:12 PM

    Hi Thomas,

    Try this,

    try {

    String username = WDClientUser.getCurrentUser().getSAPUser.getUniqueName();

    } catch (WDUMException e) {

    <i>//Handle exception</i>

    }

    Add comment
    10|10000 characters needed characters exceeded