Skip to Content
avatar image
Former Member

How to get the column header texts in classical WDA tables

Hi folks!

How can I get the header texts of each table column for a "normal" WDA table (not ALV!)?

Thanx for any help!

Regards,

Volker

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Feb 18, 2011 at 07:36 PM

    I am thinking of the following logic.

    1. Get the columns from the table

    2.Loop through the columns

    3.get the header.

    DATA:
        lt_column                          TYPE cl_wd_table_column=>tt_table_column,
        lo_column                          TYPE REF TO cl_wd_table_column,
        lo_caption                         type ref to cl_wd_caption.
     
      lt_column = lo_table->get_columns( ).
     
      LOOP AT lt_column INTO lo_column.
       lo_caption = lo_column->get_header(  ).
    "do what ever you want to do with header.
      ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Ah now! Making it correct and int works.

      lo_table_col_caption = lo_table_column->get_header( ).

      lv_string = lo_table_col_caption->get_text( ).

      Thank you!

      Regards,

      Volker