Internal Tables in Release 4.6A
In Release 4.6A, the following new features have been introduced in
internal tables:
1 New key specification for unstructured internal tables
2 References as table key
3 Strings as table key
4 Key definition for tables in the ABAP Dictionary
5 Key for unstructured tables
6 Changes to the internal structure
7 Sort without specifying the sort key
8 Access to write-protected tables
9 Index areas in table extensions
10 IS REQUESTED with TABLES parameters
11 Tables as attributes of object types
12 References as line type
13 Multiple identical key specifications
ABAP_MODIFICATION_1 New Key Specification for Unstructured Internal
Tables
If the line type of an internal table has no structure, you can use
the pseudo component table_line
to specify or address the entire table line as the key. The previous
specification, the form TABLE LINE is now obsolete. If a
structure contains a component called
table_line , this leads to a warning in the syntax check.
ABAP_MODIFICATION_2 References as Table Key
References are now allowed in the key of an internal table.
ABAP_MODIFICATION_3 Strings as Table Key
Strings are now allowed in the key of an
internal table. This applies to all table types.
ABAP_MODIFICATION_4 Key Definition for tables in the
ABAP
Dictionary
If you define an internal table in the ABAP Dictionary, it is now
possible to specify the table key explicitly.
ABAP_MODIFICATION_5 Default Key of Unstructured Tables
The default key of an internal table without a line structure always
consists of the whole line. The exception is a table of a table, which
has an empty key.
ABAP_MODIFICATION_6 Change to the Internal Structure
Previously, internal tables have been represented at runtime using a
structure 256 bytes long. This has now been replaced by a reference that
is only 8 bytes long. This means that structures containing tables as
components or tables that contain other tables can now be stored far
more efficiently, since an empty table now only requires 8 bytes of
memory instead of 256. This is particularly noticeable with structures
with only a few entries. Furthermore, the header of a filled
table now only requires approximately half of the 256 bytes previously
required (the actual figure depends on the platform).
Remember to adjust any structures in the ABAP Dictionary with a field
of length 256 bytes intended to accommodate a table header .
ABAP_MODIFICATION_7 Sorting Without Specifying the Sort Key
Sorting an internal table with type
STANDARD or HASHED using the
SORT sort statement now returns a correct
result, even if you do not specify the sort key in the BY
addition.
ABAP_MODIFICATION_8 Accessing Write-Protected Tables
In the DELETE ,
INSERT , and MODIFY statements
,the system returns a syntax error if you specify a write-protected
table. This error used to result in a runtime error.
ABAP_MODIFICATION_9 Index Areas with Table Extensions
The statements INSERT LINES OF itab ...
and APPEND LINES OF itab ... return syntax
errors if the source table has the type HASHED or ANY
andyou use the FROM and TO additions to specify an index
range. This error used to result in a runtime error.
ABAP_MODIFICATION_10 IS REQUESTED with TABLES
Parameters
When you use the relational operator IS
REQUESTED in connection with TABLES
parameters in update function modules, the syntax check issues a
warning . These parameters are always
supplied.
ABAP_MODIFICATION_11 Tables as Attributes of Objects
The LOOP , READ
, SORT ,
DELETE , and MODIFY statements now
support access to the attributes of objects as the key of an internal
table.
If the line type of an internal table contains object reference
variables from ABAP Objects as the
component comp , you can use the attributes attr of the
object to which the reference is pointing as key values when reading,
sorting, and changing the table. This is possible in the following
statements:
LOOP AT itab ... WHERE comp- attr ...
READ TABLE itab ... WITH [TABLE] KEY comp- attr = ...
SORT itab BY comp- attr ...
DELETE itab WHERE comp- attr ...
MODIFY itab ... TRANSPORTING ... WHERE comp- attr ...
ABAP_MODIFICATION_12 References as Line Type
In the declarative statements DATA ,
STATICS , and TYPES
, you may use object and data references as the line type of an
internal table.
ABAP_MODIFICATION_13 Multiple Identical Key Specifications
Identical key specifications that occur more than once in the
READ statement lead to a
warning .
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved