ALV

Excluding a column from ALV Display using CL_SALV_TABLE Class

It is assumed that the reader of the article has knowledge in ALV Grid Programming.

Please use the SET_VISIBLE method of the class CL_SALV_COLUMN_TABLE.

REPORT  ztest.
 
DATA: ispfli TYPE TABLE OF spfli.
DATA: gr_table TYPE REF TO cl_salv_table.
data: gr_funct type ref to cl_salv_functions.
data: gr_columns type ref to cl_salv_columns_table.
data: gr_column type ref to CL_SALV_COLUMN_table.
 
START-OF-SELECTION.
 
  SELECT * INTO TABLE ispfli FROM spfli.
 
  TRY.
      CALL METHOD cl_salv_table=>factory
        IMPORTING
          r_salv_table = gr_table
        CHANGING
          t_table      = ispfli.
    CATCH cx_salv_msg .
  ENDTRY.
 
  gr_funct = gr_table->get_functions( ).
  gr_funct->set_all( Abap_True ).
 
  gr_columns = gr_table->get_columns( ).
  gr_column ?= gr_columns->Get_Column( 'DISTANCE' ).
  gr_column->SET_VISIBLE( abap_false ).
 
  gr_table->display( ).
 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image