It is possible to detach or reattach assignment blocks in a BSP overview page. First thing to do is determine the name of the assignment block that we want to hide. There are two possibilities for this purpose
- If the block we want to hide is a defined as a component usage in our BSP, the name of the assignment block should consist of the usage name and the interface name seperated by a dot
- If the block is defined in our BSP component, the name should consist of the component name and the view name seperated by a slash symbol
In order to hide the assignment block of which name we have just determined, we need to redifine the method DETACH_STATIC_OVW_VIEWS of the controller class of the overview page using the redifine button
Next we insert the code to do the hiding under the conditions we provide
DATA: ls_viewid TYPE bsp_dlc_ovw_stat_view_attach. CONSTANTS: c_view_id TYPE string VALUE 'ZCoUsGSCM.MainWindow'. *IF control ls_viewid-viewid = c_view_id. APPEND ls_viewid TO rt_viewid. *ENDIF.
Similarly, we need to redefine the REATTACH_STATIC_OVW_VIEWS method to reattach the hidden assignment blocks
And insert the following code
DATA: ls_viewid TYPE bsp_dlc_ovw_stat_view_attach. CONSTANTS: c_view_id TYPE string VALUE 'ZCoUsGSCM.MainWindow'. * IF control. READ TABLE view_area WITH KEY appl_viewname = c_view_id type = space traymode = abap_undefined TRANSPORTING NO FIELDS. IF sy-subrc = 0. ls_viewid-viewid = c_view_id. APPEND ls_viewid TO rt_return. ENDIF. * ENDIF.