CL_SALV_COLUMNS_TABLE

How to color the cells of SAP ALV Display of type CL_SALV_COLUMNS_TABLE

Step 1: Desired cells of the SAP ALV Display can be colored using the structure lvc_s_scol. The color codes must be set to each line of record. Therefore the structure of the ALV Display must be extended with the additional field with an internal table of type lvc_t_scol. TYPES: BEGIN OF ty_contact.               INCLUDE STRUCTURE …

How to color the cells of SAP ALV Display of type CL_SALV_COLUMNS_TABLE Read More »

How to use various cell types in new SAP ALV Display of type CL_SALV_TABLE?

               The various cell types can be used both in container mode and complete mode. The cell types are constructed based on the Attribute of the Interface ‘IF_SALV_C_CELL_TYPE’. Type of cell Attribute of IF_SALV_C_CELL_TYPE Display mode container / complete Event Text => Text Both – Checkbox => Checkbox Both – Checkbox hotspot => checkbox_hotspot Both …

How to use various cell types in new SAP ALV Display of type CL_SALV_TABLE? Read More »

How to optimize the width of the column of type CL_SALV_COLUMNS_TABLE

               The width of the column is optimized through three methods. Optimize all columns. Optimize one single column. Manually set the width of columns. The optimization is based on the content of the ALV Table. Optimize all columns. In order to optimize all the columns of the ALV Table, call the set_optimize method of the …

How to optimize the width of the column of type CL_SALV_COLUMNS_TABLE Read More »

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: …

How to set the column position using the class CL_SALV_COLUMNS_TABLE? Read More »

How to rename columns in SAP ALV DISPLAY of type CL_SALV_COLUMNS_TABLE.

The columns can be renamed with the object of the class cl_salv_column_table. There are four methods available such as SET_SHORT_TEXT (), SET_MEDIUM_TEXT(), SET_LONG_TEXT and SET_TOOLTIP(). The method can be chosen based on our requirement of text length. DATA lr_salv_columns_table TYPE REF TO cl_salv_columns_table. DATA lr_salv_column_table TYPE REF TO cl_salv_column_table. DATA lv_short_text TYPE scrtext_s. DATA lv_medium_text …

How to rename columns in SAP ALV DISPLAY of type CL_SALV_COLUMNS_TABLE. Read More »

How to insert and delete column in SAP ALV Display of type CL_SALV_TABLE.

The column is inserted through the field catalog of the ALV Table. It is set during the method call FACTORY (). Step1: Extend the structure either locally or globally through the Transaction SE11 with the additional field. TYPES: BEGIN OF ty_contact.                             INCLUDE STRUCTURE ztt_db_table2.                             TYPES: contact_age TYPE ZDE_contact_age.               END OF …

How to insert and delete column in SAP ALV Display of type CL_SALV_TABLE. Read More »

How to hide the column in new SAP ALV Display of type CL_SALV_COLUMNS_TABLE

The column can be edited using the column object. The Column object can be retrieved from the get_columns( ) method of the ALV object. Step1: Get the columns object from the ALV object. DATA lr_columns TYPE REF TO cl_salv_columns_table. Lr_columns = lr_alv_object->get_columns( ). Step2: From the columns object, get the particular specific column object ‘CONTACT_ID’. …

How to hide the column in new SAP ALV Display of type CL_SALV_COLUMNS_TABLE Read More »