cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the user id from Portal in WD

Former Member
0 Kudos

Hi,

I am developing a web dynpro app to be used in the portal. One requirement is to record the user id of the user who logged into the portal.

Does anyone know how to get it within the web dynpro application?

Thanks a lot!

Hart

Accepted Solutions (1)

Accepted Solutions (1)

sid-desh
Advisor
Advisor
0 Kudos

IWDClientUser wdUser = WDClientUser.getCurrentUser();

Hi Hart,

Try using the following piece of code.

IUser user = wdUser.getSAPUser();

if(user != null){

IUserAccounts[] acct = user.getUserAccounts();

if(acct[0] != null){

String strUserid = acct[0].getLogonUid();

}

......

}

else{

// code for anonymous user

}

Regards

Sidharth

Former Member
0 Kudos

Hi Sidharth,

Thanks a lot for your prompt help! These codes will definitely help me resolve the problem. Actually I am looking through some documents and got some similar codes.

Regards,

Hart

Answers (0)