Showing results for 
Search instead for 
Did you mean: 

WDClientUser API doesn't always return the current logged-in portal user!!

Former Member
0 Kudos


I have accessed a web dynpro application through an iView in Enterprise Portal. I have used the WDClientUser API provided by SAP, in this application to display the first and last name of the user who has currently logged into the portal. The methods that I have used are :

1) WDClientUser.getCurrentUser().getSAPuser().getFirstName()

2) WDClientUser.getCurrentUser().getSAPUser().getLastName()

More importantly, I am using the "WDClientUser.getCurrentUser().getSAPUser().getUniqueName()" method to check the USERID and use it to call a few BAPIs from a backend R/3 system.

Everything works fine...until the scenario described below occurs :

1) I log into the portal as user "A". Call the BAPIs through the Web Dynpro adaptive RFC model and may or may not make modifications to the SAP tables corresponding to "A".

2) I log off from the portal..using the sign-out link. Please note that I LOG OFF, and dont just close the browser, after which I am brought back to the standard log-in page.

3) In the same browser window, I now log in as, say user "B". Now when I go to the iView that contains the same web DynPro application, it sometimes, shows me the records of user "A", instead of the currently logged in , user "B".

4) It doesn't stop at just this. In fact, it works so completely, so as to allow me to call the BAPIs and make changes to the old user's records.

I have tried refreshing the browser window, iView and have even cleared the system cache, but the above sequence of events still continues. I have also disabled the client side caching of the iView and page and tried to re-run the application, but to no avail.

I have used the "WDClientUser.forceLogoffClientUser()" & "WDClientUser.releaseClientUser()" methods of the API in the wdDOExit() method of my custom controller, in an effort to explicitly remove any traces of the current user after he logs off the portal, but again, it didnt yield any significant results.

However, one thing that I have consistently observed, is that the application works perfectly as expected, when a new browser window is opened and the second login (user B) is made from this new window. In this case, the application returns results of the newly logged in user.

Please let me know if anyone of you has faced a similar situation.....

Thanks & regards,

Navneet .

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi, Navneet Nair

did you set up an OSS Message for the Portal-User Problem, if so, can u tell me the result and/or how you fixed your logon trouble...

in fact i found out, when i change the user as you describe above, i have the same problem. when then i log off again, and come back withe the just before logged in user, i get the correct result on the webdynpros. <b>So I have to log off twice to actually change</b> the corresponding result on the webdynpro - strange thing is, taht in fact on the Portal screen in the upper left corner each time, i swap users the correct username is displayed...

we are running ep 6 patch level 10...

thanks for a hint,


Message was edited by: matthias kasig

Message was edited by: matthias kasig

Former Member
0 Kudos

a fortunate guess:

i changed the settings in internet explorer to: reject all cookies - saved settings - quit internet explorer.

tried the portal logon again, changed users and everything's fine.

then i reset the browser cookie settings back to normal (medium security level) and the portal kept behaving good!

So i don't really know what was the reason for the initial misbehaviour. if somebody finds an oss hint or knows about the j2ee settings, browser settings etc, please let me know.



Former Member
0 Kudos

Please open an OSS message.