cancel
Showing results for 
Search instead for 
Did you mean: 

Rename alv header text in webdynpro abap

Former Member
0 Kudos

Hi ,

I have created two attribute PART_NUMBER and TERM_CODE in context level with type CHAR10.

AND in ALV header PART_NUMBER and TERM_CODE is displaying, which is coming from context level.

i want to rename the header of ALV to PARTNUMBER and TERMCODE.

could any one send me the sampls code or any solution?

Thanks

Rakshar

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

First get access to the ALV Model object for your ALV usage:

data: l_ref_cmp_usage type ref to if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.

  data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv( ).
  data l_table type ref to cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).

Then access the column you want to change the header on. In addition to setting the text of the header of the column, you must also force off the data dictionary binding for the field property text.

data l_column type ref to cl_salv_wd_column.
 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` ).

Former Member
0 Kudos

Hi,

after using this code in WD_INIT of the view

i am geeting a syntax error

error :- Method "WD_CPUSE_ALV" is unknown or PROTECTED or PRIVATE.

could you please tell me the reason

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Yes. You have to, of course, adjust your component usage name for whatever you named it. I named my ALV Component usage - ALV. If you named yours XYZ, for example, you would adjust this section of code to read:"

data: l_ref_cmp_usage type ref to if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_xyz( ).
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.

  data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_xyz( ).
  data l_table type ref to cl_salv_wd_config_table.

Former Member
0 Kudos

Hi,

It is working for me now,

Thank you

Rak shar

Former Member
0 Kudos

Hello,

is this also possible for the DropDown in the header, if yes, how can I fill the DropDowns values?

I will be very happy for any kind of help

Former Member
0 Kudos

HELLO,

COULD YOU PLEASE ELABORATE IT IN DETAILS.

THANKS...

Former Member
0 Kudos

hello,

there is a standard dropdown UI-Element in each ALV table, i want change the name of it and fill it with some date.

thank you for help

DebbieCloud
Participant
0 Kudos

Hi

My web dynpro give an error for line:

l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).

The l_table: not sure what mine must be.

Can someone please assist urgently?

Regards

Debbie