Conversion Rules For Elementary Data Types
Conversion Rules For Elementary Data Types
There are eight predefined ABAP data types. There are 64 possible type combinations between these elementary data types. ABAP supports automatic type conversion and length adjustment for all of them except type D (date) and type T (time) fields which cannot be converted into each other. The following conversion tables define the rules for converting elementary data types for all possible combinations of source and target fields.
P T X Not supported. Results in an error message during the syntax check or in a runtime error. The date is converted to the number of days since 01.01.0001 in hexadecimal format.
D F N I P T X
converted into a floating point number (see corresponding table). N I P T X The numeric field is transported right-justified and padded with zeros or truncated on the left. The numeric field is interpreted as a number, and transferred to the target field, where it is right-justified, and adopts a plus sign. If the target field is too short, the program may be terminated. The numeric field is converted into a character field. The character field is then converted into a time field (see corresponding table). The numeric field is converted into a packed number. The packed number is then converted into a hexadecimal number (see corresponding table).
D F N
I P T X
C D F N I P T X
The source field is transported left-justified without conversion. Not supported. Results in an error message during the syntax check or in a runtime error. The source field is converted into a packed number. The packed number is then converted into a floating point number (see corresponding table). The date is converted into a character field. The character field is then converted into a numeric text field (see corresponding table). The date is converted to the number of seconds since midnight.
Transport without conversion. The date is converted to the number of seconds since midnight in hexadecimal format.