cancel
Showing results for 
Search instead for 
Did you mean: 

Logged on Users in Portal

Former Member
0 Kudos

Hi All,

I wanted to develop an webdynpro Java application which gives the list of users logged currenly in the Portal.

Which API do i need to run after.Any help is appreciated.

Abhi

Accepted Solutions (1)

Accepted Solutions (1)

former_member185086
Active Contributor
0 Kudos

Hi

1.You have to call com.sap.security.api.sda (Select the DC and right click --select component development --show in --component property --go to dependency -- add and find this dc )

2.Code for get all logged in user

com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;

IWDClientUser currentUsers[] = WDClientUser.getClientUsers();

//Displaying the count of logged on users
wdComponentAPI.getMessageManager().reportSuccess("Number of logged on Users in the portal"+currentUsers.length);

for(int i = 0; i < currentUsers.length; i++)
{
if(currentUsers.getSAPUser() != null)
{
//Displaying the logged on users;
wdComponentAPI.getMessageManager().reportSuccess("User - "+currentUsers.getSAPUser().getUniqueName());
}
}Note: I used reportSuccess statement to show the output, instead you can bind the list of users to a node and show in the Table

Best Regards

Satish Kumar

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks to all.

-Abhi

Former Member
0 Kudos

Hi,

Use IWDClientUser intetface to get the require data.

Thanks & Regards

Ravi

pravesh_verma
Active Contributor
0 Kudos

Hi,

Try and use this link:

Also note that you have to add the UME DC as dependency.

Regards,

Pravesh

Former Member
0 Kudos

Hi

You can capture the Logged in User From Webdynpro

Write this code on WD do init

IWDClientUser user = WDClientUser.getLoggedInClientUser();

wdContext.currentContextElement().setUserid(user.getSAPUser().getUniqueName());

Add this file

Goto-.Used dcs-Add used dcActive -


SAP_JEE-----Sap.Security.sda.api..

Regards

Kirankumar M