Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Urgent: Get portal user in a web dynpro

Hi all!

I have an urgent matter. I am developing a specific portal service in web dynpro. Does anyone of you know how can i know the user using this service. To be more explicit, this service is used to diplay the information concerning the portal user. I am using a BAPI to get this information from the backend. One of the imports parameters of this BAPI is the userID of the one requesting this information. How can I get this userID.

Your help is really appreciated.

Thanks a lot!

Hajar

replied

you could place them in the wdDoInit()-method of the/a Controller and save the UserID in a Context-Element of type String. You can make this Context-Element available to other Views etc. via Mapping.

Maybe it would be useful to put a try/catch-block around the mentioned code, if the User wasn't authenticated before.

kr, achim

Example:

try{
IWDClientUser user = WDClientUser.getCurrentUser();
wdContext.currentContextElement().setUserID(user.getSAPUser().getUniqueName().toUpperCase());
catch (Exception ex) {
...
}

you have to add the com.sap.security.api.jar to your build path of your aplication.

Message was edited by: Achim Hauck

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question