on 01-09-2006 11:09 PM
I am trying to get the user from the portal in my dynpro application. I have seen a lot of others having the similar problem on this forum, but none comes up with an solution. So any of you have an answere why this codes returns null?
public java.lang.String getUser( )
{
//@@begin getUser()
try {
String firstname, lastname;
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
firstname = user.getFirstName();
lastname = user.getLastName();
return firstname + " " + lastname;
}
catch (Exception e) {
return e.getMessage();
}
hi Kristroffer,
the webdynpro application go to
Java build path -> Libraries -> Add external jars ->
com.sap.securities -> lib -> com.sap.security.api.
also check whether these imports are there
import com.sap.security.api.IUser;
import com.sap.security.api.IUserAccount;
Regards
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx Rohit!
It works on computer (the one that has installed the portal, nwds, was).. but on the other computers connecting to the portal, my getUser is null and goes into exception. I have added com.sap.security.api.jar
as an variable to the project and checked that it imports com.sap.security.api.IUser; and
import com.sap.security.api.IUserAccount;
got any other suggestions?
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.