ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Assignments → Lossless Assignments → Lossless Assignments - Rules
Checking Internal Tables
The operator EXACT
checks a table specified as an argument row-by-row against the table-like row type:
- If the row types are elementary, each row is checked for elementary data objects.
- If the row types are structured, each row is checked for structures.
- If the row types are table-like, the check described here is performed. If the inner table is a table with an elementary row type, the row types must be compatible.
The table category and the table key are ignored by the check.
If the check raises an exception due to an invalid value or loss of values, the target table is filled with all rows assigned up to that point.
Other versions: 7.31 | 7.40 | 7.54
Notes
- If an internal table with elementary row type is converted, this row type does not have to be compatible
with the target row type. It only needs to be convertible according to the conditions of
EXACT
. If an internal table with elementary row type is converted that occurs as an inner table of another table, it is handled like a structure components and the row types must be compatible.
- If internal tables are converted using the operator
EXACT
, only internal tables with elementary row type can raise an exception.
Example
The first seven rows of the internal table itab
are assigned to the internal
table jtab
. When the eighth row is assigned, the exception CX_SY_CONVERSION_NO_DATE occurs.
DATA itab TYPE STANDARD TABLE OF d
WITH EMPTY KEY.
itab = VALUE #( ( CONV d( '20160101' ) )
( CONV d( '20160201' ) )
( CONV d( '20160301' ) )
( CONV d( '20160401' ) )
( CONV d( '20160501' ) )
( CONV d( '20160601' ) )
( CONV d( '20160701' ) )
( CONV d( '20160ß01' ) )
( CONV d( '20160901' ) )
( CONV d( '20161001' ) )
( CONV d( '20161101' ) )
( CONV d( '20161201' ) ) ).
DATA jtab TYPE SORTED TABLE OF string
WITH UNIQUE KEY table_line.
TRY.
jtab = EXACT #( itab ).
CATCH cx_sy_conversion_no_date.
ENDTRY.
cl_demo_output=>display( jtab ).