on 11-07-2008 11:58 AM
Hi,
Like we have sy-uname in ABAP for getting the current user,
could you please tell me what is the method name for getting the current user ID in web dynpro coding ?
Could you please tell me standard documentation which can be refered to find method names etc for any operation required to be done ?
thanks
hi,
Could you please tell me how to add the security.api jar file to my project
when i do add extrenal jar file, it opens up C:/programfiles/java/jre1.4.2_12 where i am not able to find any security.jar file
thanks
r
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Try the following code to get vurrently logged in user on portal :
IWDClientUser l_ClntUser = WDClientUser.getCurrentUser();
IUser l_IUser = l_ClntUser.getSAPUser();
IUserAccount[] l_IUA = l_IUser.getUserAccounts();
String uniqName = l_IUA[0].getLogonUid();
If the logged-in user is a URL parameter then try the following :
Eg: to extract the parameter "User" from the URL
String LogginUser = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("User");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rita,
Use this code,
PS: Before using this code add security_2.0.jar file into ur Java build path.
//@@begin CheckAllUsersLogin()
IWDClientUser currentUsers[]=WDClientUser.getClientUsers();
loggedOnUserID = WDClientUser.getCurrentUser().getClientUserID();
//Displaying the count of logged on users
wdComponentAPI.getMessageManager().reportSuccess("Number of logged on Users in the portal - "+(currentUsers.length-1));
for(int i=0;i<currentUsers.length;i++){
if(currentUsers<i>!=null){
// Displaying the logged on users;
if(!currentUsers<i>.getLastName().equals("Guest")){
String first= currentUsers<i>.getFirstName();
wdComponentAPI.getMessageManager().reportSuccess("User - "currentUsers<i>.getFirstName()" "+currentUsers<i>.getLastName());
}
}
}
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rita,
There are few API's which give the complete user management information for the current logged in user. However if you just want to get the logged on user ID then you can use the following API.
Please read the following code.
String loggedOnUserID = null;
try {
loggedOnUserID = WDClientUser.getCurrentUser().getClientUserID();
} catch (Exception e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
Apart from this you can get all the details of the user through user management API's.
If you need any further information please let me know.
Thanks and Regards
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.