SAP CONVERSION ITAB



Get Example source ABAP code based on a different SAP table
  



Conversion Rules for Internal Tables
Internal tables can only be assigned to internal tables. Whether or not assignment is possible depends exclusively on the line type, and it is independent of table type, table key, and number of lines. Internal tables can be assigned to each other if their line types are compatible or convertible.
When assigning an internal table to another, the lines of the target table are deleted. A new line is created in the target table for each line in the source table and then filled with the line content of the source table. The lines are stored according to the table category. For assignments to a sorted table, the content is automatically sorted, and hashed tables are stored according to the hash algorithm.
The content of the individual lines in the source table is assigned to the lines of the target table according to the same rules as between individual data objects of the corresponding line types. The same basic rule as for all conversions applies: The converted content of the single lines in the source table must be within the value range of the line type in the target table.
Assignments between internal tables and data objects that are not internal tables lead to a syntax error or the runtime error OBJECTS_MOVE_NOT_SUPPORTED.



Latest notes:

In internal tables with compatible or convertible line types, an uncatchable exception can be raised during assignment if, for exam ple, in the target table a duplicate of a unique primary table key or secondary table key would be created.
Internal tables with elementary line types can raise the same catchable exceptions as assignments between the associated elementary data types. After an exception of this type, the target table contains all lines assigned until this point.
In assignments of an initial internal table to a filled internal table, the target table is initialized in the same way as with the statement CLEAR. This releases the memory space required for the table, except for the initial memory requirement.
NON_V5_HINTS
ABAP_HINT_END

ABAP_PGL
Avoid unexpected conversion results
ABAP_PGL_END

ABAP_EXAMPLE_VX5
A standard table text_tab with line type c of length 20 is converted to a sorted table of type string.
ABEXA 00914
ABAP_EXAMPLE_END