- •Disclaimer & Liability Notice
- •Applies To:
- •Summary
- •Prerequisites
- •Table of Contents
- •Introduction
- •Building Blocks
- •General Scheme
- •Building Field Catalog
- •Structure Of A Field Catalog
- •Building Field Catalog Semi-Automatically
- •Layout Adjustments
- •Printing Adjustments
- •Excluding Unwanted Standard Function Buttons
- •Non-Event Based Additional Functionalities
- •Changing Field Catalog or Layout after First Display
- •Setting Sort Conditions
- •Filtering
- •Making Selections
- •Retrieving and Setting Scroll Status Info
- •Coloring
- •Coloring an Entire Column
- •Coloring An Entire Row
- •Coloring Individual Cells
- •Inserting Hyperlinks
- •Making Fields As Dropdown Lists
- •Managing Display Variants
- •Event Based Additional Functionalities
- •General Scheme for the Event Handler Class
- •Hotspot Clicking
- •Double Clicking
- •Pushbuttons On The List
- •Adding Your Own Functions
- •Overriding Standard Functions
- •Context Menus
- •About Printing
- •Making ALV Grid Editable
- •Controlling Data Changes
- •Linking F1 Help to Fields
- •Linking F4 Help to Fields
- •A Piece of Troubleshooting
- •Author Bio
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 |