Lead Columns
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.
For all of the following functions, this is valid:
Display type ALV Tool |
Classic ABAP list |
Full screen |
In the Container |
Simple, two-dimensional table |
Yes |
Yes |
Yes |
Hierarchical-sequential list |
Yes |
|
|
Tree structure |
|
No |
No |
You are able to make the following settings for lead columns:
· Define the column as a lead column
· Determine the color of individual cells in the lead columns
· Prevent lead columns from scrolling
· Prevent lead columns from being hidden
You are able to define any column of the ALV output as a lead column.
Methods
Function |
Class |
Method |
Define lead columns |
CL_SALV_COLUMN_LIST |
SET_KEY |
Check whether a column is a lead column |
IS_KEY |
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.
Methods
Function |
Class |
Method |
Define color column |
CL_SALV_COLUMNS_LIST |
SET_COLOR_COLUMN |
Get color column |
GET_COLOR_COLUMN |
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.
Methods
Function |
Class |
Method |
Fix lead columns |
CL_SALV_COLUMNS_LIST |
SET_KEY_FIXATION |
Checks whether the lead columns are fixed |
HAS_KEY_FIXATION |
By default, users can hide or display columns that are part of their column set as needed. You are able to prevent users from hiding each lead column individually.
Methods
Function |
Class |
Method |
Prevent lead columns from being hidden |
CL_SALV_COLUMN_LIST |
SET_KEY_PRESENCE_REQUIRED |
Check whether the lead column can be hidden |
|
IS_KEY_PRESENCE_REQUIRED |