Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Assignments →  Assignment and Conversion Rules 

Conversion Rules for Elementary Data Objects

The programming language ABAP includes a set of built-in elementary data types. It also supports automatic type conversions and length adjustments for assignments between all these data types (with the exception of date fields, time fields, and time stamp fields, where many conversions are not applicable).

The conversion tables in the following sections define the rules for converting all possible elementary target fields for

In all conversions, it must be possible to create a value from the type-specific value range from the content of the source field; otherwise the system raises an exception 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 assigning statements whose conversion errors are either handled implicitly or that produce a runtime error directly.

After an exception, the contents of the target field are 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).

Other versions: 7.31 | 7.40 | 7.54

Programming Guideline

Avoid unexpected conversion results


Note

Enumerated types belong to the elementary data types, but are subject to special conversion rules that ensure that only permitted values can be assigned to an enumerated variable.

Continue

Numeric Source Fields

Character-Like Source Fields

Byte-Like Source Fields

Date fields, time fields, and time stamp fields as source fields