ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Assignments →  Assignment and Conversion Rules →  Conversion Rules for Elementary Data Objects →  Character-Like Source Fields → 

Source Field Type d

The conversion rules are designed in such a way that when data objects of type d are assigned to character-like data objects they behave as character-like data objects. The latter is the basis for date calculations in arithmetic expressions.

Only date entries in the format "yyyymmdd" are valid for data objects of type d, whereby "00010101" is the first valid value. The conversion rules, however, allow the assignment of date fields that contain invalid data. The latter is not recommended.

Numeric Target Fields

Target Conversion
i, (b, s) If the source field contains a valid date in the format "yyyymmdd", it is used to calculate the number of days since 01.01.0001, and this value is then converted to the internal representation of the corresponding integer. If the source field contains an invalid date, the target field is assigned the value 0. If the value range for the internal data types b and s is insufficient, the unhandleable exception CX_SY_CONVERSION_OVERFLOW is raised.
p If the source field contains a valid date in the format "yyyymmdd", it is used to calculate the number of days since 01.01.0001, and this value is then converted to the internal representation of a packed number. If the value range of the target field is too small, a handleable exception CX_SY_CONVERSION_OVERFLOW is raised. If the source field contains an invalid date, the target field is assigned the value 0.
decfloat16, decfloat34 If the source field contains a valid date in the format "yyyymmdd", it is used to calculate the number of days since 01.01.0001, and this value is then converted to the internal representation of a decimal floating point number with a scaling of 0. If the source field contains an invalid date, the target field is assigned the value 0.
f If the source field contains a valid date in the format "yyyymmdd", it is used to calculate the number of days since 01.01.0001, and this value is then converted to the internal representation of a binary floating point number. If the source field contains an invalid date, the target field is assigned the value 0.

Notes

Character-Like Target Fields

Target Conversion
c Content is handled in the same way as a source field of type c
string Content is handled in the same way as a source field of type c
n The characters in the source field are inserted in the target field, left-aligned. Trailing blanks in the source field are passed. If the target field is longer than the source field, it is padded to the right with the character "0". If the target field is shorter, it is truncated on the right.
d The content of the source field is passed unconverted.
t Not supported. Produces a syntax error or runtime error.

Byte-Like Target Fields

Target Conversion
x The content of the source field is first converted to the data type i (see above), and then to the type x (see the conversion table for source field type i, (b, s)).
xstring The content of the source field is first converted to the data type i (see above), and then to the type x (see the conversion table for source field type i, (b, s)).