ARTICLE
Checking Elementary Data Objects
In conversions between incompatible
elementary data objects , the
operator EXACT ensures
that no values are lost. Regardless of the value of the argument, the
operator EXACT generally does not permit assignments between data
objects with the following data types. The is because with these data
types, values are always lost when the
conversion rules are applied.
From x , xstring to d , n , and t and
the other way around
From x , xstring to all
numeric data types and the other way around
From d and t to b and s
Conversions from d to t (and the other way around) are not
permitted, regardless of whether the operator EXACT is used.
Other conversions that are not permitted are conversions in which
byte-like fields are converted directly or as an intermediate result to
the data type i (or the other way around).
If illegal conversions are made, a syntax error occurs, or if the cause
cannot be identified statically, an exception of the class
CX_SY_CONVERSION_EXACT_NOT_SUP is
raised. This also occurs with types for which conversions are permitted,
but for which a loss of values can be identified regardless of the
content, for example, if an conversion is made to fields that are too
short.
When permitted conversions are made between incompatible elementary data
objects, the operator EXACT checks the contents of the argument
at runtime as follows:
Check for valid values in the
argument
Check for appropriate values in the
target type
If the elementary data types for which no conversion is required are
compatible , no checks are performed and no
exceptions are raised.
Notes
When the operator EXACT is used, a handleable exception is always
raised at runtime when an illegal conversions is made. This occurs in
particular when conversions are attempted between d and t .
In all other cases, an attempted conversion of this type raises a
non-handleable exception.
If an argument contains an invalid or inappropriate value, this is
assigned to its return value, even if the operator EXACT is used.
Example ABAP Coding See Lossless Assignment .
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved