Saturday, October 11, 2008

SAP Columns

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 (see Getting the ALV Configuration Model). If there is no column object, you must create the column objects needed for your required display of the ALV output separately.

You can make the following settings for column objects:

Get a column object

Get the technical name for a column

Create and delete column a object

Set up a column header (see Column Headers)

Change the position of a column (see Position of Columns)

More Information

For information about specifying the appearance of a column, see the sections in Appearance of ALV Output.

For information about filtering, sorting, and aggregating columns, see Predefining ALV Standard Functions.

Getting a Column Object

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 whether you want to get all column objects at once so that you can handle them one after another. In both cases, you use the methods of interface class IF_SALV_WD_COLUMN_SETTINGS to do 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 for a Column

To get the name of the current column instance, you use class CL_SALV_WD_COLUMN.

Method for Getting the Technical Name of a Column

Function

Method

Get technical name

GET_ID

Creating and Deleting Column Objects

If, when getting the ALV configuration model, you specified that the system is not to generate column objects, you need to generate the column objects required for displaying the ALV data 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 appear in the user’s column set, you have to delete the corresponding column object.

When you create a column object, you enter its technical name. This name must match the name of an attribute in the context node of your application.

To create or delete a column object, you use the methods of interface class IF_SALV_WD_COLUMN_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).

Methods for Creating and Deleting Column Objects

Function

Method

Create a column object

CREATE_COLUMN

Delete a column object

DELETE_COLUMN

Delete all column objects

DELETE_COLUMNS

No comments:

Archive