on 08-25-2008 6:29 PM
Hi ,
I need to get the ECC Mapped USerID (mapped in portal) and pass it to a BAPI. ANy Idea how do I get it from UME once it is mapped in Portal.
Thanks,
-Ashwani
Aswani,
Use the following Code:
try {
IWDClientUser user = WDClientUser.getCurrentUser();
String userid = user.getSAPUser().getDisplayName();
} catch (WDUMException ex) {
wdComponentAPI.getMessageManager().reportException(
ex.getMessage(),
false);
}
With this code, you can get the USERID, DISPLAY NAME, or whatever you want.
/Raj Peddisetty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Raj,
I want for Mapped User API's . I need the backend UserID which is mapped into the portal. I ahve been using this code but getting error. I have already added the required .jar file(com.sap.portal.usermanagementapi.jar) but still it says "IPortalComponentRequest" unresolved. Let me know if you have any clue
IPortalComponentRequest req = (IPortalComponentRequest) this.getRequest();
IUserMappingService iumser = (IUserMappingService) PortalRuntime.getRuntimeResources().getService
(IUserMappingService.KEY);
IUserMappingData iumdata = iumser.getMappingData("System Alias", req.getUser());
Map map = new HashMap();
try {
iumdata.enrich(map);
} catch (Exception e) {}
String userid = (String)map.get ("user");
Hi,
Have you added sharing references to the said portal service in your web dynpro project? But do you really need to use IPortalComponentRequest? An easier way would be:
IWDClientUser loggedInUser = WDClientUser.getLoggedInClientUser();
IUser sapUser = loggedInUser.getSAPUser();
IUserMapping allUserMapping = UMFactory.getUserMapping();
try {
String backEndUserName = allUserMapping.getR3UserName (sapUser, "<system ID>", null, true);
}
catch (UMException e) {
//log
}
Regards,
Satyajit.
Hi,
if you are using WD then your code will work will little modifications:
IWDClientUser user = WDClientUser.getLoggedInClientUser();
Iuser puser = user.getSAPUser();
IUserMappingService iumser = (IUserMappingService) WDPortalUtils.getServiceReferences.(IUserMappingService.KEY);
IUserMappingData iumdata = iumser.getMappingData("System Alias",puser);
Map map = new HashMap();
try {
iumdata.enrich(map);
} catch (Exception e) {}
String userid = (String)map.get ("user");
IWDClientUser and WDPortalUtils Api is already provided by webdynpro runtime,
apart from this you have to add saaj-api.jar ,usermapping_api.jar which you have already included,
and com.sap.security.api.jar for iuser.
if you are using NWDI then these jars excluding usermapping api jars are available in webservice and com.sap.security.api.sda lib dcs.
finally in webdynpro shared references you have to give the references like this:-
PORTAL:sap.com/com.sap.portal.usermapping
Regards,
Siddharth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.