Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Table control column selection on single click

Former Member
0 Kudos
342

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

6 REPLIES 6

Former Member
0 Kudos
87

Hi,

Please find the Below link

[Link|]

Hope this will be help full,

Thanks,

Kalyan.b

0 Kudos
87

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.

viquar_iqbal
Active Contributor
0 Kudos
87

Hi

You can catch it by sy-ucomm as case and when 'ABC' sort the table .

Thanks

Viquar Iqbal

Former Member
0 Kudos
87

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

0 Kudos
87

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.

0 Kudos
87

Hi Pavan,

Were you able to answer your question? I have the same problem.

Thanks.

Regards,

Joyreen