Spend Management Blogs by SAP
Stay current on SAP Ariba for direct and indirect spend, SAP Fieldglass for workforce management, and SAP Concur for travel and expense with blog posts by SAP.
cancel
Showing results for 
Search instead for 
Did you mean: 
ivy_li
Active Contributor
0 Kudos

Some users want to control the buttons for procurement substitute via restriction of object such as S_USER_GRP.

However this is impossible since button control is hard-coded as below:

class  /SAPSRM/CL_CH_WD_DODM_PROC_SUB

method /SAPSRM/IF_CLL_MAPPER~REFRESH

...

* Set the enabled property of the Add, and Remove buttons

  IF lv_pdo_trans_mode NE /sapsrm/if_pdo_constants_gen_c=>gc_mode_displa

    lon_layout_data->set_attribute( name = 'ENABLE_ADD_SUBSTITUTE'

                                    value = abap_true ).

    lon_layout_data->set_attribute( name = 'ENABLE_REMOVE_SUBSTITUTE'

                                    value = abap_true ).

  ELSE.

    lon_layout_data->set_attribute( name = 'ENABLE_ADD_SUBSTITUTE'

                                      value = abap_false ).

    lon_layout_data->set_attribute( name = 'ENABLE_REMOVE_SUBSTITUTE'

                                      value = abap_false ).

  ENDIF.

...

The 'enable' property for these two buttons are controlled by the mode of operation (Display or Edit).

If you changed the mode from EDIT to DISPLAY in debugger, and then the result will be the expected one.

From the current design, it is impossible to control this via user role since this is hard-coded in metadata coding.

The only option is to modify the standard coding to add user role check to enable the button.