on 08-19-2008 6:27 AM
HI
I need to develop a web dynpro application which gives the details of the portal user details who logs into portal
Can anyone provide me the code how to fetch the details of the users who logs into portal
thanks in advance
Hi,
Make sure that your WebDynpro Applications Authentication property is set to True.
To get Portal User Details you can use the following UME Api's
try
{
IWDClientUser user = WDClientUser.getLoggedInClientUser();
IUser loggedInUser = user.getSAPUser();
}
catch(UMException ume)
{
//do something
}
this Iuser objects holds all the Properties of Portal User Except its Password.
and You can retrieve it like this
loggedInUser.getFullName();
if you know the Logon id of Portal User you can Also get the IUser object like this:--
IUser user = UMFactory.getUserByLogonId("Administrator");
To use UME APIS in Webdynpro you have to refer com.sap.security.api.jar in the Build path of your WebDynpro Application.
If You Are Using NWDI then you have to use the com.sap.security.api.sda lib Dc available in NWDI for Compilation in WD DC
Hope this Help.
Regards,
Siddharth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use followng code inside Init() method of the view in which you want to access the portal user....
//Code for getting group of loged-in user
String struserName = null;
try
{
IWDClientUser user = WDClientUser.getCurrentUser();
IUser currentUser = WDClientUser.getCurrentUser().getSAPUser();
struserName = currentUser.getName();
wdContext.currentContextElement().setCtx_Va_LoginId(struserName.toUpperCase());
}
catch (Exception e) {
wdComponentAPI.getMessageManager().reportException(e.getMessage(), false);
}
// Code for getting group of loged-in user
Here for IWDClientUser ,you will have to add api com.security.api.sda
Hope this ill help you.
Thanks,
Prajakta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can get the current logged in user with following code
IUser user = WDClientUser.getCurrentUser().getSAPUser();
user.getUniqueName();
user.getCity();
You can all other information with user object.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.