cancel
Showing results for 
Search instead for 
Did you mean: 

hide fields based on user authorizations /Groups

Former Member
0 Kudos

I have a scenario where I have to hide fields on the UI based on the user who has logged in .... We have like 50 user groups and each one has about 5-10 users. I know i can do this using authority checks but dont know how to implement this in Webdynpro. Do we have to create 50 Roles? and assign to each group's user? and then use visibility property in WD to hide fields?

I know this is the way to code it but I am just wondering if there is any elegant way of doing this. I am not supposed to use compnent configurations either.

Just wondering how its done on other webdynpro projects?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

i think that i would do the same as you described. When you start the application, do the authorization check and based on the authorization manipulate the context_element attributes properties (read_only,enabled,visible).

Bind the ui element properties to the context_element properties.

Former Member
0 Kudos

HI Baskaran,

Even I have a similar issue. My requirement is to enable/disable the input on Input Fields on a std. sap WD screen. The approach that I followed --

-- Create an enhancement for the WD application.

-- Make change to the UI element property in the post-exit of WDDOMODIFYVIEW.

The problem is that I am not too sure of the code that I need to put in there.

I tried putting in the following code --


data: l_input type ref to cl_wd_input_field.
    l_input ?= view->get_element( 'COUNTRY' ).
    l_input->set_read_only( abap_true ).

But for some reasons this does not work. I get a dump related to READ ONLY .

Is there anything else which I need to do.

Former Member
0 Kudos

So my question is more about How to handle the User Authorizations etc . If I have 50 groups do I need 50 Roles created?... Please any response to this??? I know how to hide fields etc in WD but i would like to know how to handle all the groups and its users?

Edited by: xyz on Mar 1, 2011 9:12 AM

Edited by: xyz on Mar 1, 2011 9:13 AM

Former Member
0 Kudos

Hi xyz,

You have to:

1. Create ONE portal role and all the classic R/3 roles.

2. Make the mapping user <-> R/3 roles.

3. In user administration the R/3 roles becomes user groups and you assign all of them to the portal one

4. Make a generic WD application (with all possible fields for all users).

5. Bind the "enabled/disabled" properties of the fields or group of fields to be handled according to authorization.

6. In WDDOINIT, make your authority check and populate the context according to the result (disabled if false... etc).

Regards,

Mathieu