on 07-23-2008 12:47 PM
i need to catch the user name and validate them who were login to application .
what is procedure in webdynpro application.
and what are the steps.
Jagan,
The code is here,
try {
IUser user = WDClientUser.getCurrentUser().getSAPUser();
String Name = user.getDisplayName();
} catch (WDUMException ex) {
}
Similar way you can get the user porperties.
Ramganesan Karuppaiyah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
To validate the login user, get the login user details, and check the permissions.
this [guide|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1c693fcf-0201-0010-d9bb-f48b1d8c9706] help you.
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
I am sorry i gave a wrong code before as i didnt read question correctly sorry for that.Try this code it may help to some extent
{
// get the currently logged in user
IWDClientUser wdUser = WDClientUser.getCurrentUser();
//get the com.sap.security.api.Iuser; It is null in case wdUser represents an anonymous user
IUser user = wdUser.getSAPUser();
//check whether the user is anonymous
if (user != null)
{
//access logon ID by iterating through the IUserAccount array
IUserAccount[] acct = user.getUserAccounts();
if(acct[0] != null)
{
String strUserid = acct[0].getLogonUid();
//pass the value obtained from the portal to value attribute
wdContext.currentNode().setAttribute(new String(strUserid));
}
}
}
Note: Defining the IUser will show an error. To resolve this:
Right-click the project in SAP NetWeaver Developer Studio.
Select Properties.
Choose Java build path -> Libraries -> Add Variable -> Select variable WD_RUNTIME -> Extend -> com.sap.security -> lib -> com.sap.security.api.jar.
Open this file and retype the code.
Thanks,
Tulasi
Edited by: Tulasi Palnati on Jul 24, 2008 7:12 AM
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 the below code to get login user.
IWDClientUser user = WDClientUser.getCurrentUser();
userid = user.getSAPUser().getUniqueName();
Thanks,
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U can get the user id of the logged in user:
int beginindex=WDClientUser.getCurrentUser().getSAPUser().getUniqueID().lastIndexOf(".")+1;
Regards,
Padmalatha.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.