cancel
Showing results for 
Search instead for 
Did you mean: 

get user from Portal

Former Member
0 Kudos

Hey

Im trying to get the user from the Portal.

Im using following code:

IWDClientUser user = WDClientUser.getCurrentUser();

String User = user.getFirstName() + " " + user.getLastName();

the problem is that this code only works on one client. If i try another client with the same user, it doesnt return anything. What could be wrong? Am I missing some jar files?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kristoffer,

Your code is not enough to get Portal user.I am not also understanding your problem with 2 different clients.What you mean by 2 clients.Is that 2 different pc's with development environment or just 2 different browsers ?.

Anyway you can try this code to get the portal user and probably you have to change ep5 user things.From ep6 getting ep5 user is depriciated but it will still work.

IWDClientUser wdClientUser = WDClientUser.getCurrentUser();

IUser sapUser = wdClientUser.getSAPUser();

IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);

Former Member
0 Kudos

Hey

the code i wrote works on one client. By one client i meen a computer connecting to the portal where the dynpro App. is.. But it doesnt work on any other clients/computer.. thats strange..

anyway, i tried your code, but i get the compilation error that it cant resolve IUser as a type

Former Member
0 Kudos

Kristoffer,

You need to import

com.sapportals.portal.security.usermanagement.IUser

Go to your eclipse plugins folder

JDT\eclipse\plugins\com.sap.tc.security\lib\

tc_sec_compat.jar

Former Member
0 Kudos

thanx. it runs now, but it only returns useraccount on one of the clients. got any other suggestions of what it could be?

Answers (0)