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

control button in user account.PNG

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.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply