cancel
Showing results for 
Search instead for 
Did you mean: 

get user id code

Former Member
0 Kudos

Hi

Can anyone provide me the code for a wd application where you get the Portal user's user id.

As I am new to this could you also please explain me the process in detail.

thanks and your help is appreciated.

Regards

Henry

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

Hi Henry,

Open "Web Dynpro" forum`s first page, type "get Portal user id" in "Froum Search" and click "Go". You will find tons of detailed information.

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Henry,

As Maksim said you get lot of threads regarding the same.

The following code might be helpful.

IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();

if(user != null){
IUserAccounts[] acct = user.getUserAccounts();
if(acct[0] != null){
String strUserid = acct[0].getLogonUid();
}

And Don't forget to include com.sap.security.api.jar

which is present in plugins folder of eclipse

plugins->com.sap.security->lib->com.sap.security.api.jar

This jar is for IUser

Rgds,

Santhosh