cancel
Showing results for 
Search instead for 
Did you mean: 

change ALV column Header

former_member216705
Participant
0 Kudos

Hello masters:

I have problems to change the column header that belongs to a dynamic ALV in a Web dynpro.

I'm using the next code to do that.

NOTE: I did the same to change the tooltip for the same column, and It´s working fine!!!

¿Does anybody know why this happen, and what do I have to do?

DATA: lr_cmdl TYPE REF TO cl_salv_wd_config_table,

lr_col TYPE REF TO cl_salv_wd_column,

lr_header TYPE REF TO cl_salv_wd_column_header.

DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .

lo_interfacecontroller = wd_this->wd_cpifc_alv( ).

lr_cmdl = lo_interfacecontroller->get_model( ).

  • Set header texts

lr_col = lr_cmdl->if_salv_wd_column_settings~get_column( 'AMOUNT_2008' ).

lr_header = lr_col->get_header( ).

  • This doesn't change the column header ************

CALL METHOD lr_header->set_text

EXPORTING

value = 'amount title'.

  • This last part work fine!!!!! *******************

CALL METHOD lr_header->set_tooltip

EXPORTING

value = 'header tip'.

Edited by: Rodrigo Arenas Arriola on Jan 14, 2009 7:31 PM

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You have to be sure and clear the current text assignments first otherwise the data dictionary tests can override the tests you supply.

l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
  data l_header type ref to cl_salv_wd_column_header.
  l_header = l_column->get_header( ).
  l_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 ).
  l_header->set_text( `Posting Date` ).

Answers (1)

Answers (1)

former_member216705
Participant
0 Kudos

My friend, you're a great master!!!

Thank you, problem solved...