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: 

How to use SORT functionality in table maintance genrator

Former Member
0 Kudos
777

Hi ,

I would like to sort the entries in table maintance genrator. I have added the sort ascending and sort descending button on the table maintance genrator screen. but how we can come to know which coloumn is selected on in that genrator.

For example: There are three fields 1.Vendor no. 2. Vendor name and 3.Run date.

Here if user want to sort the data by vendor no ascending, then first he will click on vendor no coloum and then click on Ascending button.

My question is how we will understand user has clicl on Vendor no? for ascending button sy-ucomm will genrate.

Can anyone please guide me in this regards.

Thx

1 ACCEPTED SOLUTION

Former Member
0 Kudos
311

In the table maintenance generator, depending on events you can set the sort order.

Go to TMG and in the menu Environment -> modification -> events, add an even name that comes from the F4 help of the field (Event at data base entry creation).

In the editor present in the next column, you can write the code to sort the table as per your wish.

Thanks,

Sowmya

2 REPLIES 2

Former Member
0 Kudos
311

Hi,

data: fieldname(20).

Use "GET CURSOR FIELD fieldname.

This instruction returns you the field in wich the cursor is in this moment.

After that, you can sort your table by this field.

SORT table BY (fieldname) ascending

or

SORT table BY (fieldname) descending

Regards,

Pepe

Former Member
0 Kudos
312

In the table maintenance generator, depending on events you can set the sort order.

Go to TMG and in the menu Environment -> modification -> events, add an even name that comes from the F4 help of the field (Event at data base entry creation).

In the editor present in the next column, you can write the code to sort the table as per your wish.

Thanks,

Sowmya