Line Colors
To change the color of a line in the ALV Grid, add an extra field to your data table that contains a code representing the color of the line. This is a character field with length 4. Add the field at the end of the line type of your internal table. If you are using a global structure type to describe the contents of the internal table, the color column will not be displayed. Instead, the ALV uses it to format the line accordingly.
The INCLUDE TYPE or INCLUDE STRUCTURE statement provides a simple way of defining the necessary line type for the data table, locally in the program.
Color Options
Components of the Color Field Value
Cell Colors
To highlight individual cells using colors, extend the line type of the output data table, adding an internal table of lvc_t_scol type. The contents of the internal table are not displayed; they contain information that controls the output.
Changing of the Cell Color
The steps to change the cell color are as follows:
To extend the output data table, add an internal table of lvc_t_scol type.
The contents of the internal table are not the output, but are included only for the layout.
You must assign the name of the column containing the internal table with the color field information to the ctab_fname field of the layout structure. Transfer the layout structure and the output table using the set_table_for_first_display method.
Hiding of Standard Functions
The possible function codes are defined as constants of the cl_gui_alv_grid class. The constants for function codes have the MC_FC_ prefix. The MC_MB_ prefix represents an entire menu in the toolbar.
Pass the table to the standard functions when you call the set_table_for_first_display method. To deactivate all functions on the application toolbar, you can use the MC_FC_EXCL_ALL constant.
To hide the entire toolbar, set the no_toolbar parameter of the layout structure to X and pass the layout structure to set_table_for_first_display.