Conversion Rules for Elementary Data Types

The programming language ABAP contains ten predefined elementary data types. It supports automatic type conversion and length adjustment for all of these data types with the exception of assignments between the types AB> d (date) and t (time), a conversion of which is not useful. The following conversion tables define the conversion rules for all possible elementary target fields for source fields of the type:

In all conversions, it must be possible to create a valid value for the data type of the target field from the content of the source field, otherwise the system triggers an exception that is defined in one of the subclasses of the class CX_SY_CONVERSION_ERROR. The corresponding runtime errors are catchable and are grouped in the exception group CONVERSION_ERRORS.

When converting character-type data objects to numeric data objects, the display of numeric values in character-like fields must be taken into account.

In the case of a subfield access to an operand of the type d or t, the subfield is treated like an operand of the type n and the relevant conversion rules apply.