How to control toolbar buttons in Entity search for MDG custom objects
This document explains how to control tool bar buttons for e.g. Hiding/Adding buttons in Entity search applications provided for custom objects by SAP by using BADI USMD_SEARCH.
For custom objects or custom data models , SAP has provided following search applications.
USMD_ENTITY_SEARCH(Till MDG 6.1):
USMD_SEARCH(From MDG 7.0):
The above mentioned applications could be generically used for searching the data of all the entities defined in a custom data model.
In both the applications , certain tool bar buttons are pre delivered by SAP.
Sometimes it might be necessary to hide some of the buttons for e.g. Mass Change for all or certain entities of a data model . It might also be needed to add some additional tool bar buttons.
This could be achieved by creating implementation of BADI USMD_SEARCH and by implementing necessary coding in the method Initialize and Process_Event of the implementing class.
First step is to create an implementation of BADI USMD_SEARCH. The custom data model should be set as a filter criteria
- Hiding standard tool bar buttons:
Hiding tool bar buttons could be achieved manipulating exporting parameter ET_STANDARD_EVENT of method INITIALIZE.
The tool bar button to be hidden should be passed to field EVENT_ID. For USMD_ENTITY_SEARCH and USMD_SEARCH , event ids are different.
Following are the list of standard event ids available for USMD_ENTITY_SEARCH.
- ALV_FCT_CREATE(Create Button)
- ALV_FCT_CHANGE(Change Button)
- ALV_FCT_COPY(Copy Button)
- ALV_FCT_MASSCHANGE(Mass Change Button)
- ALV_FCT_CNGDOCS(Change Documents Button)
- ALV_FCT_WHEREUSED(Where Used Button)
Following are the list of standard event ids available for USMD_SEARCH
- NEW(Create Button)
- COPY(Copy Button)
- MASS_CHANGE(Mass Change Button)
- MULTI(Multi-Processing button)
- CHANGE_DOCS( Change Documents button)
- REPL_STATUS ( Replication Status button)
- REPLICATE( Replicate button)
Visibility could be controlled by passing the following values to field VISIBILITY
With this implementation , tool bar button Mass change would be hidden
2. Adding new tool bar buttons:
New tool bar buttons could be added by manipulating parameter ET_ADDITIONAL_EVENT of method INITIALIZE.
Handling of the event triggered by this button could be done in method PROCESS_EVENT