SAP CONVERSION ELEMENTARY



Get Example source ABAP code based on a different SAP table
  



Conversion Rules for Elementary Data Objects
The programming language ABAP contains a set of built-in elementary data types. It also supports automatic type conversions and length adjustments for assignments between all these data types except for date fields, time fields, and time stamp fields , where conversions do not make sense.
The conversion tables in the following sections define the rules for converting all possible elementary target fields for
Numeric source fields
Character-like source fields
Byte-like source fields
Date fields, time fields, and time stamp fields as source fields
In all conversions, it must be possible to create a value from the type-specific value range from the content of the source field; o therwise an exception is raised that is defined in one of the subclasses of the class CX_SY_CONVERSION_ERROR. Conversion errors can usually be handled using CATCH. There are some statements in which assignments take place whose conversion errors are either handled implicitly or lead to a runtime error directly.
After an exception, the content of the target field is undefined and should not be used. After an exception, the target field can contain either the previous value or an invalid value (the latter is the case after an overflow of a floating point number, for example).

ABAP_PGL
Avoid unexpected conversion results
ABAP_PGL_END



Latest notes:

Enumerated types are elementary data types, but special conversion rules apply, which ensure that only allowed values can be assigned to an enumerated variable.
NON_V5_HINTS
ABAP_HINT_END