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

View Entire Topic
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