cancel
Showing results for 
Search instead for 
Did you mean: 

get access to ALL Portal Users by Web DynPro App

Former Member
0 Kudos

Hello Everybody,

I have searched and found all code samples to get access to the "current Portal User" and its attributes.

But I need them <b>all at once</b> to update a second database (oracle), holding the same information of these users.

the "<i>com.sap.security.api</i>"-jar doesn't have a methode to match another user than the "<i>current</i>" one (or two, three...).

Perhaps I didn't look close enough...

So perhaps someone has got a solution for my problem...

Thanx for reading

Thorsten

Accepted Solutions (1)

Accepted Solutions (1)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

U can get all the users with

ISearchResult isr = userfactory.getUniqueIDs();

Then use get each user and his attributes in a loop like

for (int i = 0; i < isr.size(); i++) {

uniqueid = isr.next().toString();

iuser = userfactory.getUser(uniqueid);

String firstname = iuser.getFirstName();

.....

.....

}

Like this u can get the attributes of all users here itself.

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

Hello Raman,

thank you for your quick answer...

Unfortunatelly, I don't know which library has to be imported into my WebDynpro-App to call for "<i>userfactory</i>"... "<i>organized import</i>" didn't fix the problem...

All I can say is that I haven't used your code-example yet...

Is this library, I obviously don't have, part of your Netweaver Version or an external one? Mine is v2.0.9...

I must tell you (all), that I am a newbee in programming java. And I also excepted to develop only by WDPro...

See ya later

Thorsten

Former Member
0 Kudos

Hi,

Look at the following threads,

/thread/53891 [original link is broken]

/thread/60313 [original link is broken]

May be helpful to you.

Regards

Srinivasan T

Former Member
0 Kudos

IWDClientUser wdUser = WDClientUser.getCurrentUser();

IUser user = wdUser.getSAPUser();

if (user!=null)

{

IUserAccount[] acc = user.getUserAccounts();

for(int i=0;i<acc.size;i++)

{

loginuser=acc<i>.getLogonUid();

....

.....

}

}

like acc<i>.getLogonUid() you can get other attributes.

Imports:

import com.sap.security.api.IUser;

import com.sap.security.api.IUserAccount;

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

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

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Check for these imports.

import com.sap.security.api.ISearchResult;

import com.sap.security.api.IUser;

import com.sap.security.api.IUserFactory;

import com.sap.security.api.UMException;

import com.sap.security.api.UMFactory;

IUserFactory userfactory = UMFactory.getUserFactory();

IUser iuser = null;

String uniqueid = "";

are ur declarations.

Include the jar com.sap.security.api.jar from eclipse/plugins/com.sap.security/lib folder.

This will work for any version of NetWeaver Dev Studio.

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

Hello to everyone,

your hints are useful.

I fixed it and get all data I need to have...

Thank you @ll

Thorsten

Answers (0)