Columns
Use
The column objects are visible elements that define the ALV display. The columns have the same names as the corresponding field objects and attributes in the context node. If you do not want to display the values of the field, you can delete the corresponding column object. You can also display the values of a field in as many columns as you want and in several different ways.
Depending on how you got the ALV configuration model, there is either just one, identically named column object for each attribute of your context node, or there is no column object at all (see Getting the ALV Configuration Model). In the latter case, you must generate the column objects required for the desired display of the ALV display separately.
You can make the following settings for column objects:
-
Get column object
-
Get the technical name of a column
-
Create and delete column objects
-
Set up a column header (see Column Headers)
-
Change the position of a column (see Position of Columns)
More Information
-
For information on designing the appearance of a column, see the sections below Defining the Appearance of ALV Display.
-
For information on filtering, sorting, and aggregating columns, see Configuring Standard ALV Functions.
Getting a Column Object
In order to make the required settings for a column, you first have to get the instance of the column. You can decide whether you address a specific column object by its name or get all column objects at once in order to handle them one after another. In both cases you use the methods of the interface class IF_SALV_WD_COLUMN_SETTINGS for this (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for getting column objects
|
Function |
Method |
|
Get individual column object |
GET_COLUMN |
|
Get all column objects |
GET_COLUMNS |
Getting the Technical Name of a Column
Use class CL_SALV_WD_COLUMN to get the name of the current column instance.
Method for getting the technical name of a column
|
Function |
Method |
|
Get technical column name |
GET_ID |
Creating and Deleting Column Objects
If, when getting the ALV configuration model, you defined that the system should not generate column objects, you need to generate the column objects required for displaying the ALV data yourself in your application.
All columns for which a column object exists are displayed to the user in a column set. If you do not want a column to be displayed to a user, you have to delete the corresponding column object.
To generate or delete a column object, use the methods of the interface class IF_SALV_WD_COLUMN_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for generating and deleting column objects
|
Function |
Method |
|
Create column object |
CREATE_COLUMN |
|
Delete column object |
DELETE_COLUMN |
|
Delete all column objects |
DELETE_COLUMNS |