2007 Jul 09 5:40 AM
any can explain me the meaning of blocked text which is given below.
waiting for ur reply.
You cannot sort a sorted table using the SORT statement. The system always maintains these
tables automatically by their sort order. If an internal table is statically recognizable as a sorted
table, the SORT statement causes a syntax error. <i><b>If the table is a generic sorted table, the
SORT statement causes a runtime error if the sort key is not the same as an extract of the
beginning of the table key, you sort in descending order, or use the AS TEXT addition.</b></i> In other
words, the SORT statement is only allowed for generic internal tables, if it does not violate the
internal sort order.
any can explain me the meaning of blocked text which is given below.
waiting for ur reply.
You cannot sort a sorted table using the SORT statement. The system always maintains these
tables automatically by their sort order. If an internal table is statically recognizable as a sorted
table, the SORT statement causes a syntax error. <i><b>If the table is a generic sorted table, the
SORT statement causes a runtime error if the sort key is not the same as an extract of the
beginning of the table key, you sort in descending order, or use the AS TEXT addition.</b></i> In other
words, the SORT statement is only allowed for generic internal tables, if it does not violate the
internal sort order.
2007 Jul 09 5:52 AM
HI,
This clearly means that you cannot sort an SORT internal table.
IF you apply sort command on SORT TABLE , the system causes a runtime error if the sort key is not the same as you give when defining the sort internal table..
regards,
nazeer
2007 Jul 09 6:37 AM
2007 Jul 09 5:53 AM
Hi,
There are 3 types of internal tables:
STANDARD
SORTED
HASHED
Sort statement on internal table can be used only for STANDARD & HASED internal tables.
For a predefined SORTED internal table, you cannot use SORT statement & such internal tables can be populated only by INSERT statement.
Best regards,
Prashant
2007 Jul 09 5:59 AM
hi,
sorted tables are generally sorted and there is no need to give explicit sort command for these types of table. in sorted tables all key fields should be given first in order to maintain data consistency among records of database table.
sprted tables generally sort records while data is being populated from databse tables to internal tables. using index of table we can access all records of sorted internal table.
if helpful reward some points.
with regards,
Suresh.A
2007 Jul 09 6:46 AM
Hi,
Sorted Internal Tables
Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard tables and sorted tables both belong to the generic group index tables.
This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of
table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key.