cancel
Showing results for 
Search instead for 
Did you mean: 

how to read the column name of the Table.

Former Member
0 Kudos

hi

I have applied sort functionality to the Table columns. It is working fine but I need to read the table column name before sorting ( On which column user trying to sort ).

Thank you all,

Rama...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi rama krishnan.......

you can make use of the method get_key_attribute_name in the interface if_wd_table_method_hndl... this will solve it.

---regards,

alex b justin

Former Member
0 Kudos

Hi Alex

Thank you very much for your valid input.

But I am facing one problem here. To get sort functionality I added following logic in WDDOMODIFYVIEW method.

DATA wd_table TYPE REF TO cl_wd_table.

CHECK first_time = abap_true.

wd_table ?= view->get_element( 'TABLE_NAME' ).

wd_this->table_control ?= wd_table->_method_handler.

wd_this->table_control->set_key_attribute_name( 'COL_NAME1' ).

here I hard coded first column name(i.e. COL_NAME1). Is it correct?

and added following code in SORT ACTION of table i.e.

wd_this->table_control->apply_sorting( ).

To get column name I am using the method in SORT ACTION of table which you mentioned but always I am getting COL_NAME1 only....

Please help me how can I rectify this...

Thank you

Rama