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

sort with out sort command

Former Member
0 Likes
766

How can we sort the internal table with out sort command.

6 REPLIES 6
Read only

h_senden2
Active Contributor
0 Likes
721

I don't think it's possible. You can appending the entries in a sorted way. But when you enter another record that not fit the sorting, you have to sort it with the sort statement.

Why can't you use the sort statement ?

regards

Hans

Message was edited by: Hans Senden

Read only

Former Member
0 Likes
721

y r u not want to use sort...

it is very simple to write .

sort itab....

Read only

Former Member
0 Likes
721

Hi,

When retrieving the data from the database table into internal table, use order by clause to sort the contents,

Rgds,

Read only

andreas_mann3
Active Contributor
0 Likes
721

hi,

use sorted table

Read only

Former Member
0 Likes
721

DECLARE A SORTED INTERNAL TABLE.

DATA : ITAB TYPE SORTED TABLE OF MARA WITH UNIQUE KEY MATNR.

Now, whatever data you are inserting into ITAB will be SORTED automatically.

You CANNOT use APPEND statement with SORTED tables, have to use INSERT statement. You don't have to use the SORT statement.

regards,

Ravi

Note : Please mark all the helpful answers and close the thread if the issue is resolved.

Read only

Former Member
0 Likes
721

hi,

you can declare your itab as sorted table.then it will be automatically sorted with out sorting it.you can do this way...

data: itab type sorted table of mara with non-unique key matnr.

Regards

vijay