cancel
Showing results for 
Search instead for 
Did you mean: 

Sap User/Password

Former Member
0 Kudos

Hi,

I would like in my WebDynpro to retreive SAP User and Password corresponding to a Portal User.

should i use "IUserMappingService"?

Joseph

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Joseph,

U can IuserMapping Service

Check the code snipped below which might satisfy ur requirement.

IWDClientUser user1 = WDClientUser.forceLoggedInClientUser();

IUser user2 = user1.getSAPUser();

IUserMapping test = UMFactory.getUserMapping();

Map map=null;

try {

String name =test.getR3UserName(user2,"SAPLOGONTICKET",map,true);

wdComponentAPI.getMessageManager().reportSuccess("name"+name);

} catch (UMException e) {

// TODO Auto-generated catch block

wdComponentAPI.getMessageManager().reportSuccess(e.toString());

}

The second paramter in getR3UserName is logonmethod

It is either "SAPLOGONTICKET" or UIDPW based on ur usermapping logon method in portal.

Hope this helps

Regards,

Sowjanya.

Former Member
0 Kudos

hi Bharathwaj ,

The code you gave me retrieve the "Portal User", I wanted the Sap User. But thank you because I learned something.

Sowjanya, Point goes to you. Thank you it's worked fine

Former Member
0 Kudos

ok it's returns the SAP User, but I didn't understand how to retreive the PassWord...

thank you

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

We can find the jar file required in the path

drive:\Program Files\SAP\JDT\eclipse\plugins\com.sap.security\lib

com.sap.security.api.jar.

To get the user

IWDClientUser wdUser = WDClientUser.getCurrentUser();

IUser user = wdUser.getSAPUser();

if (user != null) { IUserAccount[] acct = user.getUserAccounts();

if(acct[0] != null)

{

strUserid = acct[0].getLogonUid();

}

}

strUserid will give the userID.

Is this ur requirement ?

Regards

Bharathwaj