简体   繁体   中英

How to exclude unnecessary buttons in ALV toolbar?

So, inside the TOOLBAR event of the CL_GUI_ALV_GRID the parameter E_OBJECT has the table MT_TOOLBAR that I can access to change all the buttons manually.

Is there a better way to include/exclude standard buttons in the toolbar than simply creating them like custom-buttons in the toolbar event?

So, inside the TOOLBAR event of the CL_GUI_ALV_GRID the parameter E_OBJECT has the table MT_TOOLBAR that I can access to change all the buttons manually.

Is there a better way to include/exclude standard buttons in the toolbar than simply creating them like custom-buttons in the toolbar event?

So, inside the TOOLBAR event of the CL_GUI_ALV_GRID the parameter E_OBJECT has the table MT_TOOLBAR that I can access to change all the buttons manually.

Is there a better way to include/exclude standard buttons in the toolbar than simply creating them like custom-buttons in the toolbar event?

class lcl_event_alv definition . public section .

methods handle_toolbar for event toolbar of cl_gui_alv_grid
  importing e_object e_interactive sender.

class lcl_event_alv implementation .

method handle_toolbar.

delete e_object->mt_toolbar where function = '&LOCAL&INSERT_ROW'  or function = '&LOCAL&DELETE_ROW'
                                or function = '&LOCAL&APPEND'     or function = '&LOCAL&COPY'
                                or function = '&LOCAL&PASTE'      or function = '&LOCAL&CUT'
                                or function = '&LOCAL&COPY_ROW'   or function = '&LOCAL&CUT'.

endmethod.

data : go_event type ref to lcl_event_alv.

create object go_event .
set handler go_event->handle_toolbar for go_grid1.

call method go_grid1->set_table_for_first_display
  exporting
    is_layout       = gd_layout
    is_variant      = value disvariant( report = sy-repid handle = 'GO_GRID1' )
    i_save          = 'A'
  changing
    it_fieldcatalog = gt_fcat1
    it_outtab       = gt_items1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM