Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
raghu3
Contributor

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

  1. 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

    • cl_wd_uielement=>e_visible-none(01)
    • cl_wd_uielement=>e_visible-visible(02)


    Example implementation:

      With this implementation , tool bar button Mass change would be hidden

      USMD_ENTITY_SEARCH

   

   

        USMD_SEARCH

  

    


    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

           

3 Comments
Labels in this area