on 09-16-2008 12:49 PM
Hi
How to get the user name through code in webdynpro application.
please tell me which UME api to use.
Regards
Vidyadhar
Vidyadhar,
Take a look at [this article|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e039ce31-4156-2b10-1481-bdc3ff8cae48]. This should be helpful. basically, you'll need a combination of these code lines to get what you want.
IWDClientUser clientUser = WDClientUser.getCurrentUser();
IUser user = clientUser.getSAPUser();
String displayname = user.getDisplayName();
String uniquename = user.getUniqueName();
String firstname= user.getFirstName();
String uid= user.getUniqueID();
String jobtitle= user.getJobTitle();
String lastname=user.getLastName();
Besides these properties, there are a lot more properties available with IUser class, which would be useful to you.
Hope this helps.
Vishwas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use this line of code to retrive the portal user id:
WDClientUser.getCurrentUser().getSAPUser().getUserAccounts()[0].getLogonUid().toUpperCase()
Add these 2 jar files to buildpath:
1)com.sap.security.api.jar
2)com.sap.security.api.perm.jar
For more help how to add jars :
If it's not a local project and if you use NWDI environment , here the blog how to add jars for Web Dynpro DC's.
Thanks
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
refer this pdf,its very helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the code below, you can retrive the user details
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();
}
let me know if there are any issues.
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,
use this,
String userid="";
try {
IWDClientUser user = WDClientUser.getCurrentUser();
userid = user.getSAPUser().getUniqueName();
} catch (WDUMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This code will retrieve the details,
IUserFactory factory = UMFactory.getUserFactory();
IUser user = factory.getUserByLogonID(userId);
lastName = user.getLastName();
firstName = user.getFirstName();
Regards,
Srinivasan Subbiah
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 | |
11 | |
10 | |
9 | |
9 | |
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.