SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Assignments → Lossless Assignments →Lossless Assignments - Rules
A lossless assignment checks the assigned content, before its conversion to an incompatible target object, to see whether the assignment is possible without data loss. This means:
If the source contains a valid value and no values are lost, the conversion is performed in accordance with the associated conversion rules. Otherwise no assignment is made. If it is statically detectable that one of the prerequisites is not met, a syntax error occurs. If this violation is not identified until the program is executed, a handleable exception is raised. The exception class of this exception is generally a subclass of CX_SY_CONVERSION_ERROR.
The following sections outline which rules are used by the operator EXACT when checking the content of its argument with respect to the data types involved:
If an exception is raised as a result of an invalid or inappropriate value, the VALUE attribute of the exception object is assigned this value in character form; this value is generally also included in the exception text.
No checks are made for:
A syntax check warning is produced if it is determined (statically) that no checks are performed for the combination of argument and target type, so making EXACT superfluous.
Note
Since lossless checks are only performed for conversions to incompatible data types, it is best to only use the operator EXACT to fill data objects that should only be given valid objects. Other types of assignments that require a start value to be specified in the declaration using VALUE can generate invalid values that are then not recognized when a lossless assignment is made to a compatible target field.
Example
See Lossless Assignment.