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

how to sort a sorted internal table .

Former Member
0 Likes
6,331

There is an internal table which is sorted

sort IS_DLV_DELNOTE-it_gen[] by material.

then its giving an error as

@8O@ Global Definitions "IS_DLV_DELNOTE-IT_GEN[]" is a table of the kind SORTED. You cannot use the SORT command with this type of table.

how to use the command..?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,710

By default when you define a sorted table you are already telling the table to sort by certain fields. When you execute the sort command on it via different fields, you are going to conflict w/ the original definition.

If this table will be sorted via different fields, I suggest you use a normal header table instead. However, a pre-defined sorted table will save you some time and CPU cycles.

Edit: To clarify - sorted tables will save you time and CPU cycles during read, but actually increase CPU usage during inserts (because it has to insert the data in a sorted manner)

Edited by: Kevin Lin on Jul 2, 2008 8:31 PM

There is an internal table which is sorted

sort IS_DLV_DELNOTE-it_gen[] by material.

then its giving an error as

@8O@ Global Definitions "IS_DLV_DELNOTE-IT_GEN[]" is a table of the kind SORTED. You cannot use the SORT command with this type of table.

how to use the command..?

7 REPLIES 7
Read only

Former Member
0 Likes
3,711

By default when you define a sorted table you are already telling the table to sort by certain fields. When you execute the sort command on it via different fields, you are going to conflict w/ the original definition.

If this table will be sorted via different fields, I suggest you use a normal header table instead. However, a pre-defined sorted table will save you some time and CPU cycles.

Edit: To clarify - sorted tables will save you time and CPU cycles during read, but actually increase CPU usage during inserts (because it has to insert the data in a sorted manner)

Edited by: Kevin Lin on Jul 2, 2008 8:31 PM

Read only

0 Likes
3,710

Actually IS_DLV_DELNOTE-it_gen is assighned to standard stucture which is sorted and I can change the sorted field.

Read only

0 Likes
3,710

Sorry I cant sort the table..

is there any alternative for sort statement..?

Read only

Former Member
0 Likes
3,710

Hello,

The table that you're using was defined like sorted table and it will be always sorted. You cannot sort it!

But if you want to sort it change its declaration to be a standard table.

Another option is to change the table keys. In this case you need to check if you'll get problems with UNIQUE keys.

Regards.

Read only

0 Likes
3,710

declare a standard temp internal table, move the data from ur sorted to standard and do the sort.

Read only

0 Likes
3,710

I have created the standard table

then moved the sorted table to standard internal table

then sorted the standard internal table.

then I want to move to sort table again..but I am unable to do it.

Read only

0 Likes
3,710

You can't append data to sorted table. Use INSERT statement.