cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro application error ( urgent ! )

Former Member
0 Kudos

Hi experts ,

I created a WebDynpro application as code example

"<b>Code to Capture Portal User ID in a Web Dynpro Application</b>" on SDN .

I add a fuction to iview of my application , the code as follow :

public void GetLogonID( )

{

Try

{

// get the currently logged in user

IWDClientUser wdUser = WDClientUser.getCurrentUser();

//get the com.sap.security.api.Iuser; It is null in case wdUser represents an anonymous user

IUser user = wdUser.getSAPUser();

//check whether the user is anonymous

if (user != null)

{

//access logon ID by iterating through the IUserAccount array

IUserAccount[] acct = user.getUserAccounts();

if(acct[0] != null)

{

String strUserid = acct[0].getLogonUid();

//pass the value obtained from the portal to value attribute

wdContext.currentNode().setAttribute(new String(strUserid));

}

}

}

}

There are 3 error information as follow :

<b>IWDClientUser cannot be resolved or is not a type .

WDClientUser cannot be resolved

The method currentNode() is undefined for the type IPrivateGetPortalUserView.IContextNode</b>

I had add com.sap.security.api.jar to variable,as follow:

Choose Java build path -> Libraries -> Add Variable -> Select variable WD_RUNTIME -> Extend -> com.sap.security -> lib -> com.sap.security.api.jar.

And I can't save the change.

I am new of Web Dynpro development.

<b>How to correct the error and make the project executable ?</b>Thank you !

Best Regards,

Jianguo Chen

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a770132b-0901-0010-5a88-b228ccc7b7b6">Code to Capture Portal User ID in a Web Dynpro Application</a>

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Press CTRL-Shift-O (Organize imports) to add all needed import statements. Then the errors about missing IWD and WD imports should disappear.

About the third message: wdContext.currentNode() makes no sense to me, should be something like wdContext.current<name-of-some-node>Element().

Armin

Former Member
0 Kudos

Hai,

Create a library project add your jars to server/provider.xml

create sda and deploy it. Add jar reference from this library. add library refernce as

Valery said.

regards,

Former Member
0 Kudos

Hi Jianguo Chen,

You have to add the <b>security.api</b> jar file to your proejct inorder resolve your problem.

Right click on your project -> properties->Java Build Path-> Add external Jars -> now select the security.apt jar file and add it.

If you are working eith DC refer to the following thread.

Regards,

Jhansi

Former Member
0 Kudos

Hi Jhansi Miryala ,

I had add the com.sap.security.api.jar before last post, and the problem still occured.

Best Regards,

Jianguo Chen

Former Member
0 Kudos

Jianguo

Open Project Properties -> WebDynpro References -> Libraries and add line com.sap.security.api.sda

VS