cancel
Showing results for 
Search instead for 
Did you mean: 

How to get portal user inside web dynpro application

Former Member
0 Kudos

Hi Gurys!

Maybe somebody can help me.

I need to get portal user inside web dynpro application (abap).

All portal users are mapped to one r/3 user.

Thank you very much in advance.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Mikalai,

Here is the code to get the portal users in the WebDynpro app.

Import package com.sap.tc.webdynpro.services.sal.um.api

To get current users

trY{

IWDClientUser clientUser = WDClientUser.getCurrentUser();

WDContext.currentContextElement().setUser(clientUser.getLastName());

}

catch(Exception e)

{

}

Find the no of portal users logged in

IWDClientUser clientUsers[] = WDClientUser.getCurrentUsers();

wdContext.currentContextElement().setLength(clientUsers.length);

There are some other methods present in the package which may help u.

Mr.Chowdary

Former Member
0 Kudos

Thanks everybody, but i need solution for abap

Former Member
0 Kudos

This code will capture the user in portal to webdynpro,

IWDClientUser wdUser = WDClientUser.forceLoggedInClientUser();

IUser user = wdUser.getSAPUser();

String userID = user.getUniqueName();

Award points if found usefull.

Former Member
0 Kudos

Hello Hanif Kukkalli

I need to get logged on portal user from web dynpro application (abap)

Transfer login via URL parameter is are not good solution

Former Member
0 Kudos

that code is for java, I am unaware in AbAp.

and it gets both logged in user id in java and if not logged in due to expiry of session, it forces to login again.

I used this in WD in Java.

maybe these parameters help

IWDClientUser wdUser = WDClientUser.forceLoggedInClientUser();

IUser user = wdUser.getSAPUser();

Check for wdclientuser in AbAp, this fetches the userID.

and IUser fetches the user details in portal.

ankur_garg5
Active Contributor
0 Kudos

Hi Mikalai,

See the following thread, you might get some info:

Bye

Ankur

Do reward points if it helps!!

Former Member
0 Kudos

Hi! Mikali,

i have a little doubt about your question?

Do you want all the users who has portal account or only those users who are currently logged-in the portal?

what is dataSource you are using to store the portal Users, is it any LDAP server?

regards,

Mithileshwar

Former Member
0 Kudos

Hi Mithileshwar.

Ofcourse this is currently logged-in the portal user.