2009 Feb 05 7:00 AM
Dear experts,
I have a requirement where user can sort table control data on single click on any of the column headers. I am talking about table control on an SAP module pool screen.This is easy to do with a separate pushbutton for sort. However, I am not able to find out how to trigger an event when the user single clicks a column header. If an event is triggered, I can then sort the table data based on the selected column.
Please help.
Thanks..
Pavan
2009 Feb 05 7:04 AM
2009 Feb 05 8:31 AM
hello,
Thanks for the reply. but it talks about row selection where a box column is given in the left. What I need is the functionality to sort data when user clicks at the column header.
2009 Feb 05 8:37 AM
Hi
You can catch it by sy-ucomm as case and when 'ABC' sort the table .
Thanks
Viquar Iqbal
2009 Feb 05 8:40 AM
Hi,
Please Check this Code Below.
cASE sy-ucomm.
WHEN 'ASCENDING'.
...
...
GET CURSOR FIELD w_cursor.
...
...
PERFORM get_asc_sort_value.
form get_asc_sort_value
sy-lsind = 1.
w_cursor = w_cursor+9.
SORT t_spfli BY (w_cursor).
....
Thanks
kalyan.B
2009 Feb 05 8:48 AM
The problem I am facing is how to trigger an event on single click at the column header. Once an event is triggered and the control goes to the program, then I can put my code there for sorting. But it seems nothing happens when you click at the column header of a table control.
2009 Aug 12 6:49 AM
Hi Pavan,
Were you able to answer your question? I have the same problem.
Thanks.
Regards,
Joyreen