cancel
Showing results for 
Search instead for 
Did you mean: 

Making standard fields non editable

Former Member
0 Kudos

Hi,

My requirement is to make few standard fields(eg.Supplier field in item source of supply in Shopping cart)as non editable depending upon the role of logged in user.I need to know whether should we need to enhance the WDDOMODIFYVIEW( ) method of the respective web dynpro component to acheive this or any other approach for this.

Thanks and Regards,

Rohini

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Rohani,

Go to SPRO->SAP SRM->Cross App. basic setting -> Extension & field control -> Config. Field control -> Field control on Item Level.

Define you own Class/method. You can read the user roles and enable/Disable the field.

Thanks.

Former Member
0 Kudos

Hi Surender,

Thanks for your reply.I have a doubt like how will we know the structure of that standard field.If i check my WD component,it belongs to /SAPSRM/S_CLL_WD_SUPPLIER-PARTNER.But in the customising table for metadata,if I search for PARTNER*,it is giving only this entry.

/SAPSRM/S_PDO_MDF_BO_SC_IT 0040 PARTNER_PROD BUS2121 06 BBP_PARTNER_PROD ITM FLD

Can you please help me on this?

Thanks and Regards,

Rohini

Former Member
0 Kudos

Rohani, Yes It is not available in the Item Control config.

You can implement BADI WD_BADI_DOMODIFYVIEW to control the field in different View.

Sample Code, This might help you.

DATA: lr_uielementTYPE REF TO cl_wd_uielement.

If view->name = 'V_DODC_SC_I_SOS'

lr_uielement ?= view->get_element( 'FIXED_SUPPLIER ).

lr_uielement->set_enabled( lv_enable ).

lr_uielement->set_visible( '01' ).

endif.

Former Member
0 Kudos

Hi Surender,

I need a clarification.Can't I do my implementation in post-exit method of wddomodifyview()?I tried doing and when I call the BAPI to get the user details,I am getting the dump.My issue is how to get the roles of logged in user in WDDOMODIFYVIEW() method.

Thanks and Regards,

Rohini

Former Member
0 Kudos

You can do it. But why are you getting a dump due to BAPI that you have used?

Former Member
0 Kudos

Hi Surendar,

The error was due to parameter passing.I have corrected the error.The "Assign Supplier" button enabled property is always checked.Also the visible property is bound to the attribute "V_DODC_SC_I_SOS.M_AS_FIXED_SUPPLIER.ASSIGN_FIXED_SUPPL_ITM".When I try to change this value in my postexit,it is giving me an error that the boolean value "ASSIGN_FIXED_SUPPL_ITM" cannot be changed.Also my requirement is to disable the Button(not making it disppear).Could you please tell mehow can i acheive this?

Regards,

Rohini

Former Member
0 Kudos

I am not sure why you are not going for the standard method of using authorization object, which is specially designed only for this purpose..

by the way - i enhanced the view V_DODC_SC_I_SOS in your SoS WD component and i dint find any dump..

are you sure you are using post exit not a pre-exit!!!

DATA: ret2 type table of bapiret2.
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
  EXPORTING
    username             = sy-uname
  tables
    return               = ret2.

  DATA :wd_por_en TYPE REF TO cl_wd_input_field.
  wd_por_en ?= view->get_element('FIXED_SUPPLIER').
  CALL METHOD wd_por_en->set_enabled
    EXPORTING
      value = abap_false.

dint dump..

Former Member
0 Kudos

and this is the code to disable the button

DATA: wd_button type ref to CL_WD_BUTTON.
wd_button ?= view->get_element('ASSIGN_FIXED_SUPPL').
  CALL METHOD wd_button->set_enabled
    EXPORTING
      value = abap_false.

Former Member
0 Kudos

Hi Soumya,

Thank you very much.It really helped me to solve my problem.I have a doubt whether it is a good practice to call BAPI from WDDOMODIFYVIEW() METHOD.Could you pls clarify me

Thanks,

Rohini

Former Member
0 Kudos

You can call the BAPI from a WD Method. It is perfectly fine. Hope you have got your issue resolved.

Former Member
0 Kudos

mate, BAPIs are good fellows. you can use them as long as you know what they are used for.

Answers (1)

Answers (1)

Former Member
0 Kudos

the fixed supplier field is controlled though the below authorization object

authorization object BBP_FUNCT value FIXED_SUP .. take this out for the users for whom you dont want supplier field to appear. it wont be available in SC

Former Member
0 Kudos

Hi Soumya,

Thanks for your reply.Could you please tell in detail how to acheive using the authorization object?Can't we do it in metadata customizing table.I need to make the Supplier Input field and Assign Supplier button as display only if I login as Requestor.

I tried to put the logic in postexit of wddomodifyview() method.But it is throwing dunp when I call the method BAPI_USER_GET_DETAIL to get the roles of user.

Thanks and Regards,

Rohini

Former Member
0 Kudos

meta data customization cannot be done in this case. as the supplier is not a item data /SAPSRM/S_PDO_MDF_BO_SC_IT

regarding the authorization object..

create a role or modify the existing roles in your system as below. ask basis team to set this

Object BBP_FUNCT SRM: General Access Aut

Field name BBP_FUNCT Function in SRM (for Au

in activity select FIXED_SUP

create another role, uncheck this FIXED_SUP

...

now the people assigned to this role where FIXED_SUP is checked will be able to see the supplier field and others wont.