cancel
Showing results for 
Search instead for 
Did you mean: 

How to set title/text for ALV table column header in WD ABAP

Former Member
0 Kudos

Hello,

I am working in WDA using SALV_WD_Table to display data in table. I need to change the column header text, the obvious way is to get the column header and call the method SET_TEXT to set new text / title. However, this method does NOT work, it does not change the column header text. I also tried the SET_TOOLTIP, this one works, but SET_TEXT does not work. Anyone has idea why this not working and do you find any go-around solution?

My version is NW 7.0

Thank

Jayson

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi jason ,

For setting Heder text for your ALV table

ip_confing type ref to CL_SALV_WD_CONFIG_TABLE.

"set alv table header
  ip_config->if_salv_wd_table_settings~r_header->set_text( 'Test ALV Header functionality' ).

first you have to hide the DDIC text and then try to set your own text .

"modify columns
  LOOP AT lt_columns INTO ls_column.
    lr_column = ls_column-r_column.
    CASE ls_column-id.
      WHEN 'MANDT'.
        "hide this field
        lr_column->set_visible( cl_wd_abstr_table_column=>e_visible-none ).
       WHEN 'SEQNR'.
        "set header to different string
        lr_column->r_header->set_ddic_binding_field( if_salv_wd_c_column_settings=>ddic_bind_none )." use this line to hide ddic text 
        lr_column->r_header->set_text( 'Position' ).	
    endcase.
  endloop.

Regards

Chinnaiya P