Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
grid.pdf
Скачиваний:
50
Добавлен:
21.05.2015
Размер:
795.44 Кб
Скачать

An Easy Reference for ALV Grid Control

Excluding Unwanted Standard Function Buttons

In your list, you may want to exclude some of the standard function buttons since they are not useful for your list. To exclude those buttons, you fill a table of type “UI_FUNCTIONS” and pass it to the parameter “IT_TOOLBAR_EXCLUDING” of the method “set_table_for_first_display”. The function codes for the buttons may be acquired by inspecting the constant attributes of the class “cl_gui_alv_grid” or putting a break point into a method, like the event-handling method of the event “after_user_command”, which deals with the ALV command.

To hide the entire toolbar, you can set the field “NO_TOOLBAR” of the layout structure to ‘X’.

FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions .

DATA ls_exclude TYPE ui_func.

ls_exclude = cl_gui_alv_grid=>mc_fc_maximum . APPEND ls_exclude TO pt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_minimum . APPEND ls_exclude TO pt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_subtot . APPEND ls_exclude TO pt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_sum . APPEND ls_exclude TO pt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_fc_average . APPEND ls_exclude TO pt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_mb_sum . APPEND ls_exclude TO pt_exclude.

ls_exclude = cl_gui_alv_grid=>mc_mb_subtot .

ENDFORM .

Code Part 9 – Filling the table to exclude unwanted standard functions

Here, names beginning with “MC_FC_” are names for functions directly and the names beginning with “MC_MB_” are for the function menus including some subfunctions as menu entries. By excluding one from the latter type, you exclude all of the functions under it.

© 2005 SAP AG

22

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]