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

Sorting dynamic table

Former Member
0 Likes
579

All,

Anybody know how to sort a dynamically created internal table ?

I've got this dynamic table with 3 fields

VBELN POSNR MATNR

and would like to sort this ?

normally it's sort int_table by vbeln posnr matnr but that's not working with a dynamic table

Any idea's ?

Regards

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
542

Hi msapsdn,

you are excused if you are not at ECC600/SAP_BASIS 700. Dynamic sort was mot defined before.

Regards,

Clemens

Edited by: Clemens Li on Sep 15, 2009 3:23 PM

3 REPLIES 3
Read only

Former Member
0 Likes
542

just press F1 on sort. you will get your answer.

sort <itab> by (otab).

Read only

Clemenss
Active Contributor
0 Likes
543

Hi msapsdn,

you are excused if you are not at ECC600/SAP_BASIS 700. Dynamic sort was mot defined before.

Regards,

Clemens

Edited by: Clemens Li on Sep 15, 2009 3:23 PM

Read only

Former Member
0 Likes
542

I tried it with a table as "sort by" but that didn't work

done it like this now

g_sort_field1 = 'VBELN'.

g_sort_field2 = 'POSNR'.

g_sort_field2 = 'MATNR'.

sort <dynamic_table>

by (g_sort_field1) (g_sort_field2) (g_sort_field3)

and that seems to work, also for the delete adjacent duplicates