Mentor SAP

Adaptation of the ALV Grid Control

You can change the layout of your ALV grid, for example, you can select the title, create a striped (zebra) pattern for the lines, or optimize the column width.

 

 

Main Fields of the Layout Structure

 

Lvc_s_layo is a global structure type and some of its fields are as below :

 

Field

Description

grid_title

Title with a maximum of 70 characters

zebra

If ‘X’, the list is displayed with a striped pattern

no_headers

If ‘X’, no column headers are displayed

sel_mode

A setting that determines how many cells lines, and column can be selected

cwidth_opt

If ‘X’, column width are optimized

info_name

An additional data table field that contains information about coloring of lines

ctab_fname

An additional data table field that contains information about coloring of individual cells.

 

Selection of Cells, Columns, and Lines

Depending on the value you enter in the sel_mode field in the layout structure, users can select individual or several lines or cells.

 

To select several entries, press the CTRL key and keep the mouse button pressed while clicking further rows, columns, or cells.

 

To select a continuous range of rows, columns or cells, press the SHIFT key and keep the mouse button pressed.

 

 

Exception Columns

You can use exceptions to indicate by means of a traffic light whether threshold values have been reached, on a line-by-line basis.

 

 

The instructions to display the threshold values are as follows:

  1. Add a character field with length 1 to your data table structure.
  2. Fill the field for each row of your data table according to the desired threshold value:
    • 0 = gray
    • 1 = red
    • 2 = yellow
    • 3 = green
  1. Enter the name of the exception column in the excp_fname field of the layout structure to the is_layout parameter of the set_table_first_display method
  2. If you enter x in the excp_led field of the layout structure, colored LED are displayed instead of the standard traffic light icons

Sort Criteria

In the internal table, insert a line for each sort criterion that you want to define.

 

To sort data using sort criteria, enter the column name in the fieldname field. If you use more than one sort criterion, in each case, enter the sequence in which the sort criterion is evaluated in the spos field. Alternatively, you can also insert the fields in the required sequence in the internal table of sort criteria. Enter X in the up field if you wish to sort the entries in ascending order.

 

If you want to sort the entries in descending order, enter X in the down field.