‎2007 Sep 25 1:34 PM
hi experts,
if am inserting records in a sorted table like
field1 field2
1 4
3 7
4 6
using append statement.
Then if i append 2 8 to the table,
what will happen?
‎2007 Sep 25 1:38 PM
Hi,
Its a sorted table. Now you are going to break the order of the Sorted Table.
So it will gives the Error.
Thanks,
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
‎2007 Sep 25 1:36 PM
Hi
it will be added after 1 2
as a second record since it is a sorted table
Regards
Anji
‎2007 Sep 25 1:37 PM
hi Shori,
your table will look like:
field1 field2
1 4
2 8
3 7
4 6
this is what sorted tables are about, if you use unsert records will be inserted into the table acc. to sort key automatically.
hope this helps
ec
‎2007 Sep 25 1:38 PM
Hi,
Its a sorted table. Now you are going to break the order of the Sorted Table.
So it will gives the Error.
Thanks,
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
‎2007 Sep 25 1:38 PM
But am using append statement.
Append statement always inserts at the last index is it?
‎2007 Sep 25 1:39 PM
Hi Shori,
Sorted table will sort the records based on the kay fields.
First it will sort based on the first key field. second preference for second key field like that.
‎2007 Sep 25 1:40 PM
Hi Shori..
In sorted Table you have to use the Command INSERT (without index) to add the records.
Then the records are INSERTED in the Sorted order as per the key fields.
Using APPEND may give dump if the Sort key is voilated .
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
‎2007 Sep 25 1:47 PM
Hi,
This is lead to ABAP dump ITAB_ILLEGAL_SORT_ORDER.
Becasue whenever an append statement is triggered table will sorted. This will lead to ABAP dump. To overcome this declare a standard internal table and append all the values and sort the table based on the key. Then pass the values to Sorted table.
Thanks,
Sriram Ponna.