Skip to Content
0
Former Member
Jul 31, 2007 at 11:57 AM

what is different between cl_salv_column and cl_salv_column_table?

1604 Views

I think gr_column using type <b>cl_salv_column</b>.(Type 1)

But many program using type <b>cl_salv_column_table</b>.(Type 2)

Why using <b>cl_salv_column_table</b> besides <b>cl_salv_column</b>?

what is benefits?

Type 1.

DATA: gr_table     TYPE REF TO cl_salv_table.
DATA: gr_columns   TYPE REF TO cl_salv_columns_table.
DATA: gr_column    TYPE REF TO cl_salv_column.

  CREATE OBJECT container
           EXPORTING container_name = 'CONTAINER'.
 
  cl_salv_table=>factory( EXPORTING r_container  = container
                          IMPORTING r_salv_table = gr_table
                           CHANGING t_table      = ispfli ).

  gr_columns = gr_table->get_columns( ).
  gr_column = gr_columns->get_column( 'CITYTO' ).
  gr_column->set_visible( if_salv_c_bool_sap=>false ).
  gr_column->set_technical( if_salv_c_bool_sap=>false ).

Type 2.

DATA: gr_table     TYPE REF TO cl_salv_table.
DATA: gr_columns   TYPE REF TO cl_salv_columns_table.
DATA: gr_column    TYPE REF TO <b>cl_salv_column_table</b>.

  cl_salv_table=>factory( EXPORTING r_container  = container
                          IMPORTING r_salv_table = gr_table
                           CHANGING t_table      = ispfli ).
  gr_columns = gr_table->get_columns( ).
  gr_column ?= gr_columns->get_column( 'LINE_NUMBER' ).
  gr_column->set_visible( if_salv_c_bool_sap=>false ).
  gr_column->set_technical( if_salv_c_bool_sap=>false ).

Message was edited by:

Ki-Joon Seo

Message was edited by:

Ki-Joon Seo

Message was edited by:

Ki-Joon Seo