How to set the column position using the class CL_SALV_COLUMNS_TABLE?

The column position in the ALV Display can be controlled using the set_column_position method of the class CL_SALV_COLUMNS_TABLE. There are two parameter used in the method call. The column name identifies the column to be positioned. The position parameter mentions the position of the column in ALV Display.

Let us look at the following example:

DATA lr_salv_columns_table TYPE REF TO cl_salv_columns_table.

lr_salv_columns_table = lr_alv_grid->get_columns ().

lr_salv_columns_table->set_column_position ( columnname = ‘CONTACT_ADDRESS’

position = 3).