cancel
Showing results for 
Search instead for 
Did you mean: 

Viewing one's detail in webdynpro

Former Member
0 Kudos

Hi Gurus,

Need your expert advise on this. we are developing in webdynpro a functionality for the users to view and update his/her own information which will be reflected in a new customized HR infotype back in R/3.

My question is,in webdynpro, how can i restrict the information based on the User logon? In other words, the logon users would only be able to see and modified his/her own details?

Thanks in advance

JOhan

Accepted Solutions (1)

Accepted Solutions (1)

Abhinav_Sharma
Contributor
0 Kudos

Hi,

You want to restrict the information based on the User logon? This is possible, you need to do some configuration of ur webdynpro application.

1) Open the Application Properties Tab (Webdynpro -> Applications -> <ur applicationName> --> Double click)

2) Click 'New'. Choose 'Pre-Defined' type and browse for authentication and select value true.

3) Save and deploy.

This will always prompt for the user credentials when u start the application.

Next you want to get the inofrmation about user loged in. Put the following code in wdDoInit():

try {

String g_empId = null;

IWDClientUser clientUser = WDClientUser.getCurrentUser();

usr = clientUser.getSAPUser();

usrEP5 = WPUMFactory.getUserFactory().getEP5User(usr);

//g_empId returns the unique id related to the user.

g_empId = usr.getUniqueName();

// Create a group in the portal and assign the user to that group. This is done

// by portal administrator.

grp = UMFactory.getGroupFactory().getGroupByUniqueName("<ur roleName>");

if (usr.isMemberOfGroup(grp.getUniqueID(), true)) {

// if the user is a membor of the group then you can call user-specific methods

}

} catch (UserManagementException e) {

wdComponentAPI.getMessageManager().reportException(

"UserManagementException : " + e.getMessage(),false);

} catch (WDUMException e) {

wdComponentAPI.getMessageManager().reportException(

"WDUMException : " + e.getMessage(),false);

}

Hope it helps.

Abhinav Sharma

Former Member
0 Kudos

Hi Abhinav,

Thanks for your reply. Need to get furhter clarification on hte following:-

=========================================================

// Create a group in the portal and assign the user to that group. This is done

// by portal administrator.

grp = UMFactory.getGroupFactory().getGroupByUniqueName("<ur roleName>");

if (usr.isMemberOfGroup(grp.getUniqueID(), true)) {

// if the user is a membor of the group then you can call user-specific methods

==========================================================

could explain a bit more on the first point and second point? Please forgive my ignorance as i'm relatively new to all this. I really appreciae the help.

Thanks

Abhinav_Sharma
Contributor
0 Kudos

Hi Johan,

I had done almost similar scenario like you where I want to assure my client that only authorised user can view his/her reocrds only..

So in the first step, I created a group in the portal (I suppose ur application will be run on portal ). In my case, my portal is connected to LDAP where all the users are maintained. (Check with ur administrator where all the users are maintained). So only LDAP user, who has sufficient priviledges, can run my application. For this to be happened, I created a Group and assign that group to a role.

In the second step, I am checking whether logged in user belongs to his group. If he is , then I set the userID with the EmployeeId , and thus in all methods, logged in user able to view only his record.

PS: I'm passing EmployeeID as a parameter to all my methods.

Hope it helps you.

Regards

Abhinav Sharma

Former Member
0 Kudos

Hi Abhinav,

Thanks for your update. I shall try your suggestion and see how it goes. I shall close this thread now. Thanks and have a nice day.

Regards,

Johan

Former Member
0 Kudos

Hi Abhinav,

I was giong through your suggestion and have 1 question. How and where do you actually map the portal userID and employeeID? is employeeID = employee number?

Former Member
0 Kudos

Hi Abhinav,

Just to re-phrase back my previous post. By doing what you have suggested, how do we actually pass back to R/3 the userID and get back details of the particular user? I'm interested to understand on how do we map our portal userID to R/3 and get back user specific details.

All i could think of is by checking whether the portal userID is = value of infotype 0105, subtype 0001. Which would then return the employee number together with the other details. Once i get the employee number, my subsequent calls back will be based on that.

Your proposed solution might be actually answering my question but i just need to understand it. Sorry to trouble you.

Regards

Answers (4)

Answers (4)

ChrisPaine
Active Contributor
0 Kudos

Sorry - proxy error caused multi-repost

Message was edited by:

Chris Paine

ChrisPaine
Active Contributor
0 Kudos

Sorry - proxy error caused multi-repost

Message was edited by:

Chris Paine

ChrisPaine
Active Contributor
0 Kudos

Sorry - proxy error caused multi-repost

Message was edited by:

Chris Paine

ChrisPaine
Active Contributor
0 Kudos

Hi Johan,

I suggest that you take a look at the existing ESS functionality, in particular the function group HRXSS_PER_MAC and the related functions that call it - eg HRXSS_PER_P0002_AU.

This should give you some idea about what you will need to develop to implement your own ESS service in the style of the standard SAP ones.

Cheers,

Chris

Former Member
0 Kudos

Hi Chris,

Thanks for the update. The problem is, the backend is on 4.7. As such all standard ESS development was purely based on ITS. However, we would want to try and develop this requirement using webdynpro. At the same time as a POC to the client.

Is there anyway you could send the webdynpro project file (zip)to me? any of the ESS (list and detail) will do. My email add is 'syedjohan@gmail.com' . Thanks a whole lot

Johan