cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Columns of a Dynamic SALV table

Former Member
0 Kudos

Hello all,

I need to hide some columns of a Dynamic SALV table, would you please show me how to do this?

Thank yo very much

Accepted Solutions (0)

Answers (1)

Answers (1)

harsha_jalakam
Active Contributor
0 Kudos

Hi Ofla,

Hiding ALV columns for the table can be done through following code.

Since you are saying that the ALV is a dynamic one, make sure that the following snippet goes at correct place , i.e, after the structure  is assigned to  ALV

DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

  lo_cmp_usage =   wd_this->wd_cpuse_sflight_alv( ).

  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.

  DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
  lo_interfacecontroller =   wd_this->wd_cpifc_sflight_alv( ).

  DATA lv_value TYPE REF TO cl_salv_wd_config_table.
  lv_value = lo_interfacecontroller->get_model(
  ).

Data:

  lo_column_settings TYPE REF TO if_salv_wd_column_settings,

  lo_column TYPE REF TO cl_salv_wd_column.

lo_column_settings ?= lv_value.

    lo_column = lo_column_settings->get_column( 'COL_NAME' ). " Column Name to be hiddeb                                                                                                     "should be given
  lo_column->set_visible( if_wdl_core=>visibility_none ).



Regards,

Harsha