简体   繁体   English

如何排除 ALV 工具栏中不必要的按钮?

[英]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.因此,在CL_GUI_ALV_GRIDTOOLBAR事件中,参数E_OBJECT具有表MT_TOOLBAR ,我可以访问该表以手动更改所有按钮。

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.因此,在CL_GUI_ALV_GRIDTOOLBAR事件中,参数E_OBJECT具有表MT_TOOLBAR ,我可以访问该表来手动更改所有按钮。

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.因此,在CL_GUI_ALV_GRIDTOOLBAR事件中,参数E_OBJECT具有表MT_TOOLBAR ,我可以访问该表来手动更改所有按钮。

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 .类 lcl_event_alv 定义。 public section .公共部分。

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

class lcl_event_alv implementation .类 lcl_event_alv 实现。

method handle_toolbar.方法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.数据:go_event 类型引用到 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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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