cancel
Showing results for 
Search instead for 
Did you mean: 

Get the user from the portal

Former Member
0 Kudos

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();

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Rohit,

Where can I find these jar file?

com.sap.security.api.

Regards,

Shakthi

Former Member
0 Kudos

hi sakthi,

In NDS right click on Your project->properties->Java Build path->Libraries->Add variable-> Eclipse Home->extend->plugins->com.sap.security->lib->com.sap.security.api.jar

Hope this helps you

Regards

Rohit

Former Member
0 Kudos

Hi Rohit,

Thank you for your valuable reply.

My problem solved.Thankx again.

Regards,

Shakthi

Former Member
0 Kudos

Hi Rohit,

I want to give you points for your answer. But I could not find any radio button to give points.

Regards,

Shakthi

Former Member
0 Kudos

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?

Former Member
0 Kudos

Hi Kristoffer,

Are you saying that your WAS and EP are on different machines. If they are on different machines this code will give you only null if you are not using authentication option. If the UME is different check the post

Hope this helps you

Regards

Rohit

Former Member
0 Kudos

Hey

They are running on the same machine. But its not set up any OSS between the portal and the web dynpro. I dont know if thats necessary?

Former Member
0 Kudos

Hi,

Create the webdynpro iview using SAP_local system

and see in portal

Regards

Rohit

Former Member
0 Kudos

Hi Rohit,

How to call my WebDynpro application from portal..

Tell me the steps..

Regards,

Shakthi

Former Member
0 Kudos

thanx man! i used an URL View. But it seems to work now after i changed the iview and defined the sap local system. Thanx again! This has really been bothering me..

Former Member
0 Kudos

You can do it in several ways. An easy way is to:

create a role

say YES to entry point on the role

create a SAP webdynpro iview and define the sap local system

assign the iview to the role

assign your self to the role

and now you will see your application on the top navigation layer

Former Member
0 Kudos

Hi Kristoffer,

How to create a role?

Could you please tell me step by step?

Regards,

Shakthi

Former Member
0 Kudos

Hey

to do this, you have to have the role content administrator.

1) Press Content Administration

2) Press Portal content

3) Rightclick on Portal Content (Under Browse)

4) Select new role

Answers (0)