cancel
Showing results for 
Search instead for 
Did you mean: 

Change column header in ALV

Former Member
0 Kudos

Hi,

I have created an ALV from a database table. Now when i execute the application it fetches the description for column headers from the database table. I have to give my own header description, how can i achieve.

Also i have some custom fields also, for them it takes description as attribute name i have to change this also.

plz suggest.

regards,

Pankaj Aggarwal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please refer this -

Regards,

Lekha.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Pankaj,

You have to remove the current DDIC text bindings.Use the code below:

DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,

lr_col_header TYPE REF TO cl_salv_wd_column_header.

lr_column_settings ?= lo_value.

  • get table of column settings - each line one column

DATA: lt_columns TYPE salv_wd_t_column_ref.

lt_columns = lr_column_settings->get_columns( ).

  • loop over table - in each loop another column can be modified

DATA: ls_column TYPE salv_wd_s_column_ref.

  • define visible columns (fields) by naming them,

DATA: ls_tooltip TYPE string.

LOOP AT lt_columns INTO ls_column. " get header of column

lr_col_header = ls_column-r_column->get_header( ).

lr_col_header->SET_PROP_DDIC_BINDING_FIELD(

property = IF_SALV_WD_C_DDIC_BINDING=>BIND_PROP_TEXT

value = IF_SALV_WD_C_DDIC_BINDING=>DDIC_BIND_NONE ). "ignore the DDic Bindings

CASE ls_column-id.

WHEN 'Column-header'.

lr_col_header->set_text( 'New Text' ).

-


-


ENDCASE.

ENDLOOP.

Regards,

Arpan