on 05-16-2008 8:54 AM
hi,
I'm having a webdynpro application. In which i want to get the values from the R/3 based on the user who logs in.
so i need to get the UPI(login id) of the user who logs in. how to get the UPI of the user who logged in??
please help me out with the detailed procedure.
Thanks & Regards,
Suresh
Hi Suresh,
Try the following code.
ISearchResult rst = UMFactory.getUserFactory().getUniqueIDs();
IUserFactory usf = UMFactory.getUserFactory();
IUser iuser = null;
IUserListElement userElement = null;
int i = 0;
while (rst.hasNext()) {
iuser =
UMFactory.getUserFactory().getUser(rst.next().toString());
String email = iuser.getEmail();
String fname = iuser.getFirstName();
String lname = iuser.getLastName();
}
I have already used this code for the similar requirement.
regards
Anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
See whether following will help you or not?:
try {
wdComponentAPI.getMessageManager().reportSuccess(WDClientUser.getCurrentUser().getSAPUser().getUniqueName());
} catch (WDUMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Regards,
Gopal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Gopal,
its getting the logged user.
but id which i'm getting has two characters in it. that is "CS45567".. here i have to remove those two characters "CS" and pass only the numerals to the RFC..
How to truncate those values.. please help me out with detailed code..
Thanks & Regards,
Suresh
Hi Suresh,
That is simple java code. You can try following:
try {
String user = WDClientUser.getCurrentUser().getSAPUser().getUniqueName();
String userId = user.substring(2);
wdComponentAPI.getMessageManager().reportSuccess(userId);
} catch (WDUMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
This will work only when you are sure that you want to truncate first 2 characters.
Regards,
Gopal
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.