Skip to Content
0
Former Member
Oct 07, 2005 at 03:14 PM

Wrong Username on getR3User call

21 Views

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