cancel
Showing results for 
Search instead for 
Did you mean: 

Binding the Portal user to Web Dynpro Data.

Former Member
0 Kudos

Hi,

Is there a way to show data in a web dynpro application dependant on the current user logged into Portal? I have a WD app that accesses data from the backend using bapi's. What I want to do is, get only the data from the backend which relates to the user currently logged into Portal. How do I do this?

Thanks

KG

Accepted Solutions (0)

Answers (1)

Answers (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Is the userid for the portal the same as it is for the backend, or would you need to use the UserMapping functionality.

You may be able to do something like this in your WD application to get the current user.

try{
IWDClientUser user = WDClientUser.getCurrentUser(); 
if(user.isAnonymousUser()){
//User is anonymous .. do something...
}else{
//user is authenticated..do something
}
}catch(WDUMException e){
//do something...
}

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Rich,

Well actually in the J2EE engine setting and SAP EP setting in NWDS you have to specify user/pwd credentials before you are able to deploy your app to the java engine. Now once the app is deployed you create a WD iView in the portal for viewing. So my question is I guess will the users credentials who logged into the portal be used for accessing the backend or will the credentials supplied at deployment time be used? If its the case of the latter how do I do the user mapping stuff?

Thanks

KG

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

When you deploy your are giving the password for SDM which is usually the j2ee_admin password. Don't worry about that. That's not what you are looking for. You set up your jCo connections for your webdynpro application, did you specify a user name and password? This is then static and I don't think you can change it at runtime. This is the user name and password that will be used to access the backend. I don't know about using the user mapping in webdynpro, but I believe that I've seen posts about it. So here is my suggestion.

The user logs on to the portal, runs your app, the application is making RFC calls to the backend with a static user name and password. If you need to get user specific data from the backend, first you will need to find the code about accessing the user mapping, also the user will need to do the mapping, only one time though. Once you have the user id for R/3 from the user mappings, pass this to your RFC call, in your RFC function module, you will now have the USERID, you can now get the data passed apond that.

Make sense?

Regards,

Rich Heilman