SAP NEWS-610-TABELLEN



Get Example source ABAP code based on a different SAP table
  



Internal Tables in ABAP Release 6.10
In ABAP_RELEASE 6.10, the following enhancements have been made to internal tables:
ITOC

ABAP_MODIFICATION_NN Creating a Table Object

Any table objects can be created at runtime by using the statement CREATE DATA. If the table type is known in full, this is respected by the syntax check.

ABAP_MODIFICATION_NN Checking the Convertibility of Key Fields

In the case of the statements READ TABLE itab WITH KEY k1 = v1 .... kn = vn and DELETE TABLE itab WITH KEY = v1 .... kn = vn, the system already checks whether the key values are convertible to the component type in the syntax check. This convertibility check is also effective for the newer variant READ ... WITH TABLE KEY .... Previously, the runtime error MOVE_NOT_SUPPORTED was raised if the conversion was not possible.

ABAP_MODIFICATION_NN Duplicate or Overlapping Key Specifications

In the case of duplicate or overlapping key specifications, the statement READ TABLE itab WITH KEY k1 = v1 .... kn = vn now raises a syntax error instead of a syntax warning. If specified dynamically, it was previously the case that the last key specification was used; now the runtime error DYN_KEY_DUPLICATE is raised.

ABAP_MODIFICATION_NN Support for Accessing Attributes

The addition ... COMPARING o->attr now makes it possible to access the attributes of objects that are components of internal tables, similar to when reading, changing, deleting, or sorting internal tables.

ABAP_MODIFICATION_NN Table Categories for Text Pools and IN Conditions

Alongside standard tables, the tables categories HASHED and SORTED are supported for the statements READ , DELETE, and INSERT TEXTPOOL ... . The IN conditions for SELECT ... WHERE and LOOP ... WHERE are also no longer dependent on the table category.

ABAP_MODIFICATION_NN Handling Overflows in COLLECT and SUM

Previously, fields of type f were only checked for possible overflows in the case of arithmetic additions. When using COLLECT and SUM, the addition was terminated in accordance with IEEE standards and a runtime error was raised as soon as the overflow limit (Infinity) was reached. Now this raises the exception CX_SY_ARITHMETIC_OVERFLOW, which can be caught using TRY.

ABAP_MODIFICATION_NN Additions ASSIGNING and REFERENCE INTO

The additions ASSIGNING and REFERENCE INTO are now available for the statements READ, LOOP, INSERT, APPEND, MODIFY, and COLLECT. Previously, only the addition ASSIGNING for the keywords LOOP and READ was available.

ABAP_MODIFICATION_NN Uppercase and Lowercase Spelling in Dynamic Components

Previously, the field content of a dynamic component always had to written in capitals, for example SORT ... BY ('COMP'). Now lowercase spelling is valid in specifications for all internal table statements.

ABAP_MODIFICATION_NN Combined Key Specifications with table_line

Now there are additional key specifications for the pseudo component table_line . Previously, it was not possible to have a key specified in the form READ ... WITH KEY table_line->attr = ... table_line = ... BINARY SEARCH, for example, where both the value of the attribute attr and the value of the reference itself were the key.

ABAP_MODIFICATION_NN Establishing the Number of Lines in an Internal Table

The number of lines in an internal table can be determined using the function LINES. For consistency, this function is intended to replace the statement DESCRIBE TABLE in the long term, since not all ABAP types can be described using DESCRIBE.

ABAP_MODIFICATION_NN Optimization when Accessing Internal Tables

For ABAP_RELEASE 6.10, optimized access to tables of the types SORTED and HASHED has been introduced. For more details, see the section on Optimized Key Operations.
In addition, in the case of assignments between internal tables of the same type, data is now only copied if changes were made to these tables. This table sharing has a positive effect on runtime and the memory required.
Until now, these optimizations had to be carried out explicitly using field symbols. Now it is possible to work normally with a work area, because no table is copied when reads are performed.

ABAP_MODIFICATION_NN Offset and Length Declarations for the Table Definition

Previously, components of the table key could be specified with offset and length declarations, which resulted in undefined runtime behavior. This is no longer possible and a syntax error is raised instead.