cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the column header texts in classical WDA tables

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi!

This I have tried this, but unfortunately when doing so I always get the table header and not the column header.

Regards,

Volker

Former Member
0 Kudos

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

Answers (0)