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: 

SORT butttons on custom screen for custom fields

Former Member
0 Kudos
187

Hi all,

I have a dedveloped a custom screen in which there are 5-6 fields.Nowi need to put Sort buttons below these fields so that I can sort these fields.

How do i do this???Is there std FM i can use to achieve the sort functionality?

5 REPLIES 5

Former Member
0 Kudos
127

No standard FM that I know of, but it's pretty easy to cody yourself:

Loop at your_table_contro-columns to find the selected column. If you allow more than one column to be selected, make sure only on is in this case.

Do a dynamic sort on the internal table using the name of the column. You will have to use the correct offset to do this.

Rob

0 Kudos
127

Hi Rob,

I dont have a table control in which I have the custom fields.The custom fields are placed in a subscreen within acustom tab in standard screen in tcode VL31N. as shown below:

Plant:

Carrier:

Bill of lading:

Packaging list:

Damage

Now below these 5 fields ,I need to display the 2 SORT buttons/icons to change the display in ASCENDING OR DESCENDING order.

How do i do this???Is there any std FM ?

Former Member
0 Kudos
127

Hi,

Any more suggestions?

praveen_hannu
Contributor
0 Kudos
127

Hi

Use the function module to sort the table CNSG_SORT_TABLE, pass the parameters as you like, but limitation is only one field you can pass for sort order. There is anothier field for "General Order", using that you can sort up to 2 fields.

Please let me know if any questions.

Thanks

Praveen

Former Member
0 Kudos
127

Moderator message - Cross post locked Rob