cancel
Showing results for 
Search instead for 
Did you mean: 

how to find out who is logged into portal through webdynpro application

Former Member
0 Kudos

hi,

whenever anyone logs in through the portal and runs a webdynpro iview, the webdynpro application should be such that it gives the name of the user logged in.

Eg, if i logiin and run the webdynpro iview, the application should display that I have logged in.

how can this be done?

its urgent.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

add the jar file com.sap.security.api.jar

IWDClientUser wdUser = null;

IUser user = null;

IUserAccount[] acct = null;

try

{

wdUser = WDClientUser.getCurrentUser();

user = wdUser.getSAPUser();

if (user!=null)

{

acct = user.getUserAccounts();

if (acct[0] != null)

{

strUserID = acct[0].getLogonUid();

wdContext.currentContextElement().setCa_UserId(strUserID);

}

else

{

strUserID = "acc is null";

}

}

else

{

strUserID = "user is null";

}

Former Member
0 Kudos

hi

thanks

Lohi,