Application Development and Automation 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: 
Read only

DYNAMIC SORT

Former Member
0 Likes
281

HOW CAN I MAKE DYNAMIC SORT

ANT IDEA??

1 REPLY 1
Read only

Former Member
0 Likes
247

Hello,

Eaxmple, your ITAB has following fields.

ITAB,

field01,

field02,

field03,

.............

..............

Dynamic sorting:

DATA: filedname01(10),

filedname02(10),

MOVE 'FIELD02' to filedname01.

MOVE 'FIELD01' to filedname02.

SORT ITAB BY (fieldname01) (fieldname02).

-


>this is same as:

SORT ITAB BY FIELD02 FIELD01.

Here you are specifying the sorting order at run time by moving the field name to the varibale filedname01 & fieldname02.

What is filedname01 & fieldname 02 is blank at run time ?

-Sorting on that field is innored.

Example:

MOVE space to filedname01.

MOVE 'FIELD01' to filedname02.

SORT ITAB BY (fieldname01) (fieldname02).

-


> this is same as:

SORT ITAB BY FIELD01.

Regards,

A.Singh