cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in reading sort column name.

Former Member
0 Kudos

Hi All

I got sort functionality to the table successfully by adding following code....

But I am facing one problem here i.e. I like to read sort column name

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 GET_KEY_ATTRIBUTE_NAME of IF_WD_TABLE_METHOD_HNDL in SORT ACTION of table but always I am getting COL_NAME1 only....

Please help me how can I rectify this...

Thank you

Rama

Accepted Solutions (1)

Accepted Solutions (1)

former_member515618
Active Participant
0 Kudos

Hi Rama,

One of the import parameters in the ON SORT event handler is COL, This holds the name of the colum on which user hads clicked on for sorting.

Hope this is what you want.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi Sravan

Thank you very much....It was solved my pb...

Thanks

Rama

Answers (0)