‎2008 Nov 14 7:06 AM
Hi,
In which scenario sorted inernal table cannot be used?.
Sorry friends If this question was asked already. I tried to find but not able to get.
Regards,
S.Senthil kumar
‎2008 Nov 14 7:24 AM
Hi,
You can not use sorted tables in these situations:
A runtime error occurs if you attempt to add a duplicate entry to a sorted table with a unique key.
When you append several lines to a sorted table, you must respect the unique key (if defined), and not violate the sort order. Otherwise, a runtime error will occur.
From SAP Help:
You can also access sorted tables by index operations. When you insert using an index, the system checks to ensure that the sort sequence has been correctly maintained. For this reason, it takes longer than inserting entries in a standard table. As a rule, you should only access sorted tables using their key.
Append cannot be used with sorted tables, you have to use INSERT.
Regards,
Ali
‎2008 Nov 14 7:43 AM
We can use append also. But the record to be appended should match sort order of internal table, else a exception with a dump will occur.
‎2008 Nov 14 8:36 AM
hi
Append cannot be used with sorted tables, you should use INSERT (records will be inserted into the internal table at the correct position to keep the sorting ok).
also Check ... is initial or if.... is inital is the same for performance reasons.
The index will be used automatically by the DB-optimizer.
Regards
Aakash