cancel
Showing results for 
Search instead for 
Did you mean: 

How get the potal userID and how to send R/3 side by using webdynpro

Former Member
0 Kudos

Hi Armin Riechert,

I need your help and guidelines.

Please help me.

I have created a View and calling a BAPI that displays some records.

In this senario how to get the Portal login user and how to send from webdynpro context to bapi input.

Please guide me what are the steps i have to follow.

I know you people are good to respond.

Thanks in advance.

Any code snippests appreciate.

Regards

nageswara.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi Nageshwar,

Check this link for catching portal user id

In the webdynpro application go to

Java build path -> Libraries -> Add external jars ->

com.sap.securities -> lib -> com.sap.security.api.

try {

IWDClientUser wdUser = WDClientUser.getCurrentUser(); IUser user = wdUser.getSAPUser();

if (user != null)

{

IUserAccount[] acct = user.getUserAccounts();

if(acct[0] != null)

{

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

wdContext.currentContextElement().setAssoid(new String(strUserid));

}

}

}

Also organise imports for the code

for passing the value to the bapi

<model node name> input = new <model node name>();

wdContext.node<model node name>().bind(input);

input.setUsername(wdContext.currentContextElement().getAssoid());

For more info on passing values to bapi see the tutorial

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/cr... a web dynpro application accessing abap functions.pdf

hope this helps you

Regards

Rohit