SAP MDG: How to Grey Out Copy Button in ERP Vendor: Purchasing Organizations UIBB ?

Hi SCN Folks, 

Hope you guys are doing great 🙂

Note 01: This blog does not include execution screenshots.
Note 02: 
The entire code was developed and validated in the SANDBOX system, with results meeting expectations.
Note 03: 
There are several ways; this blog is written about one of them.

Create customizing or enhance UIBB.

Standard Feeder Class: CL_BS_SP_GUIBB_PURCH_ORGS.

Create one custom class: ZCL_MDGS_GUIBB_PURCH_ORGS & do inherit above standard feeder class.

Now, utilize this method:  METHOD if_fpm_guibb_list~get_data.

Code:

CALL METHOD super->if_fpm_guibb_list~get_data
EXPORTING
iv_eventid = iv_eventid
it_selected_fields = it_selected_fields
iv_raised_by_own_ui = iv_raised_by_own_ui
iv_visible_rows = iv_visible_rows
iv_edit_mode = iv_edit_mode
io_extended_ctrl = io_extended_ctrl
IMPORTING
et_messages = et_messages
ev_data_changed = ev_data_changed
ev_field_usage_changed = ev_field_usage_changed
ev_action_usage_changed = ev_action_usage_changed
ev_selected_lines_changed = ev_selected_lines_changed
ev_dnd_attr_changed = ev_dnd_attr_changed
eo_itab_change_log = eo_itab_change_log
CHANGING
ct_data = ct_data
ct_field_usage = ct_field_usage
ct_action_usage = ct_action_usage
ct_selected_lines = ct_selected_lines
cv_lead_index = cv_lead_index
cv_first_visible_row = cv_first_visible_row
cs_additional_info = cs_additional_info
ct_dnd_attributes = ct_dnd_attributes.

DATA :
lv_cr_number TYPE usmd_crequest,
lv_crtype TYPE usmd_crequest_type,
lv_process TYPE usmd_process.

DATA(lo_context) = cl_usmd_app_context=>get_context( ).

IF lo_context IS BOUND.
CALL METHOD lo_context->get_attributes
IMPORTING
ev_crequest_id = lv_cr_number
ev_crequest_type = lv_crtype
ev_process = lv_process.
ENDIF.

IF lv_crtype EQ ‘ZMDGS01’.
READ TABLE ct_action_usage ASSIGNING FIELD-SYMBOL(<lfs_copy>) WITH KEY id = ‘BOL_COPY’.
<lfs_copy>-visible = ’01’.
ENDIF.

 

   

Thank You, 
Sandeep Suggu.
SAP Community Profile | SAP Profile | LinkedIn 

 

​ Hi SCN Folks, Hope you guys are doing great 🙂Note 01: This blog does not include execution screenshots.Note 02: The entire code was developed and validated in the SANDBOX system, with results meeting expectations.Note 03: There are several ways; this blog is written about one of them.Create customizing or enhance UIBB.Standard Feeder Class: CL_BS_SP_GUIBB_PURCH_ORGS.Create one custom class: ZCL_MDGS_GUIBB_PURCH_ORGS & do inherit above standard feeder class.Now, utilize this method:  METHOD if_fpm_guibb_list~get_data.Code:CALL METHOD super->if_fpm_guibb_list~get_data
EXPORTING
iv_eventid = iv_eventid
it_selected_fields = it_selected_fields
iv_raised_by_own_ui = iv_raised_by_own_ui
iv_visible_rows = iv_visible_rows
iv_edit_mode = iv_edit_mode
io_extended_ctrl = io_extended_ctrl
IMPORTING
et_messages = et_messages
ev_data_changed = ev_data_changed
ev_field_usage_changed = ev_field_usage_changed
ev_action_usage_changed = ev_action_usage_changed
ev_selected_lines_changed = ev_selected_lines_changed
ev_dnd_attr_changed = ev_dnd_attr_changed
eo_itab_change_log = eo_itab_change_log
CHANGING
ct_data = ct_data
ct_field_usage = ct_field_usage
ct_action_usage = ct_action_usage
ct_selected_lines = ct_selected_lines
cv_lead_index = cv_lead_index
cv_first_visible_row = cv_first_visible_row
cs_additional_info = cs_additional_info
ct_dnd_attributes = ct_dnd_attributes.

DATA :
lv_cr_number TYPE usmd_crequest,
lv_crtype TYPE usmd_crequest_type,
lv_process TYPE usmd_process.

DATA(lo_context) = cl_usmd_app_context=>get_context( ).

IF lo_context IS BOUND.
CALL METHOD lo_context->get_attributes
IMPORTING
ev_crequest_id = lv_cr_number
ev_crequest_type = lv_crtype
ev_process = lv_process.
ENDIF.

IF lv_crtype EQ ‘ZMDGS01’.
READ TABLE ct_action_usage ASSIGNING FIELD-SYMBOL(<lfs_copy>) WITH KEY id = ‘BOL_COPY’.
<lfs_copy>-visible = ’01’.
ENDIF.    Thank You, Sandeep Suggu.SAP Community Profile | SAP Profile | LinkedIn    Read More Technology Blog Posts by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author