on 08-10-2006 11:12 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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;
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
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.