Skip to Content
author's profile photo Former Member
Former Member

Rename alv header text in webdynpro abap

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?



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Nov 30, 2011 at 12:41 PM

    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( ).
      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( ).
        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` ).

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.