cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving User IDs from the User Mapping

Former Member
0 Kudos

On our portal under user mapping for a particular system, I would like to retrieve the User and password. Does anyone supply the code that would achieve this?

Thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I figured it out. Thanks all.

detlev_beutner
Active Contributor
0 Kudos

Hi,

have the answers been of any value for you? If yes, please consider rewarding points for helpful answers! Thanks in avance!

Best regards

Detlev

Former Member
0 Kudos

Thank Maksim, but I have a few more questions. I'm using the following code patterned from one of the snippets:

IUser iuser = request.getUser();

// get usermapping service

IUserMappingService iums =

(IUserMappingService) PortalRuntime.getRuntimeResources().getService(

IUserMappingService.KEY);

I get an error on request.getUser() saying that request is unresolved. IUserMappingService is also unresolved as is PortalRuntime.

detlev_beutner
Active Contributor
0 Kudos

Hi Steve,

> request.getUser() saying that request is unresolved

You can get the user, but not from the request (even this would theoretically be possible, but there is a more convenient way): see /thread/81722 [original link is broken] including the link to the weblog given by me.

To access IUserMappingService, see https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/958fcd90-0201-0010-38aa-d8272da593b6 page 7/8 for general hints how to access portal services; here instead of accessing a KM application (com.sap.km.application) you will need to have access to <i>com.sap.portal.usermapping</i> (and the corresponding JARs at build time).

Also see !

Hope it helps

Detlev

former_member182372
Active Contributor
0 Kudos

Hello Steve,

Are you trying to call this piece of code from Dynpro? If yes, check this (first post from Matthias). It is the standart way to obtain IUser in Dynpro. To get IUserMappingData you can use

IUserMapping mappings = UMFactory.getUserMapping();
IUserMappingData mappingData = mappings.getUserMappingData( ... );

Best regards, Maksim Rashchynski.

former_member182372
Active Contributor
0 Kudos

Hello Steve,

Check this

/thread/13806 [original link is broken]

/thread/6447 [original link is broken]

Best regards, Maksim Rashchynski.