
Lead columns are columns that have a special significance in the output. Usually you define columns that contain especially important content as lead columns.
Columns that have already been designated by the application as primary key automatically become lead columns in the ALV object model.
The following properties differentiate a lead column from a normal column:
Lead columns have a different color. This color is determined by the system.
You are able to determine whether a lead column moves when you scroll sideways through the screen like the other columns, or whether it stays where it is.
Lead columns can be found in the user's column set. By default, the user is able to hide lead columns. You are able to prevent users from hiding lead columns.
You are able to make the following settings for lead columns:
Defining the Column as a Lead Column
Determine the color of individual cells in the lead columns
Prevent Lead Columns from Scrolling
Preventing Lead Columns from Being Hidden
Defining the Column as a Lead Column
You are able to define any column of the ALV output as a lead column.
|
ALV Tool |
Display type |
Function available |
|
Simple, two-dimensional table |
Classic ABAP List |
Yes |
|
Fullscreen |
Yes |
|
|
In the Container |
Yes |
|
|
Hierarchical-sequential list |
Classic ABAP List |
Yes |
|
Tree Structure |
Fullscreen |
No |
|
In the Container |
No |
|
Function |
Class |
Method |
|
Define lead columns |
CL_SALV_COLUMN_LIST |
SET_KEY |
|
Check whether a column is a lead column |
IS_KEY |
Defining a Color in a Lead Column
Lead columns have their own background color that helps you to differentiate between them and the regular columns in your ALV output. This color is determined by the system. You are not able to change the color of the whole column. However, you are able to override the predefined background color for individual cells of the lead column: You define a separate color column , where you specify one of the possible alternative colors for the desired cell. You also use the NOKEYCOL field in the color column to explicitly deactivate the system color.
|
ALV Tool |
Display type |
Function available |
|
Simple, two-dimensional table |
Classic ABAP List |
Yes |
|
Fullscreen |
Yes |
|
|
In the Container |
Yes |
|
|
Hierarchical-sequential list |
Classic ABAP List |
Yes |
|
Tree Structure |
Fullscreen |
No |
|
In the Container |
No |
|
Function |
Class |
Method |
|
Define color column |
CL_SALV_COLUMNS_LIST |
SET_COLOR_COLUMN |
|
Get color column |
GET_COLOR_COLUMN |
Prevent Lead Columns from Scrolling
If there is not enough room for all of the columns of the ALV output to be displayed on the screen simultaneously, the user can scroll sideways until the desired column becomes visible. Usually the other columns disappear when you are doing this. You are able to determine whether the lead columns are fixed, which means that they remain visible when you scroll sideways.
|
ALV Tool |
Display type |
Function available |
|
Simple, two-dimensional table |
Classic ABAP List |
Yes |
|
Fullscreen |
Yes |
|
|
In the Container |
Yes |
|
|
Hierarchical-sequential list |
Classic ABAP List |
Yes |
|
Tree Structure |
Fullscreen |
No |
|
In the Container |
No |
|
Function |
Class |
Method |
|
Fix lead columns |
CL_SALV_COLUMNS_LIST |
SET_KEY_FIXATION |
|
Checks whether the lead columns are fixed |
HAS_KEY_FIXATION |
Hiding Lead Columns
By default, users can hide or display columns that are part of their column set as needed. In the list output of the simple, two-dimensional table you are able to prevent users from hiding each lead column individually.
|
ALV Tool |
Display type |
Function available |
|
Simple, two-dimensional table |
Classic ABAP List |
Yes |
|
Fullscreen |
No |
|
|
In the Container |
No |
|
|
Hierarchical-sequential list |
Classic ABAP List |
No |
|
Tree Structure |
Fullscreen |
No |
|
In the Container |
No |
|
Function |
Class |
Method |
|
Preventing the Hiding of Lead Columns in the List Output |
CL_SALV_COLUMN_LIST |
SET_KEY_PRESENCE_ REQUIRED |
|
Check whether the lead column can be hidden in the list output |
IS_KEY_PRESENCE_ REQUIRED |