Skip to content

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

Source Field Type xstring

Other versions: 7.31 | 7.40 | 7.54

Numeric Target Fields

Target Conversion
i, int8, (b, s) Content is handled in the same way as a sourcefield of type x. If the source field has a length of 0, the target field is assigned the value 0.
p Content is handled in the same way as a sourcefield of type x. If the source field has a length of 0, the target field is assigned the value 0.
decfloat16, decfloat34 Content is handled in the same way as a sourcefield of type x. If the source field has a length of 0, the target field is assigned the value 0.
f Content is handled in the same way as a sourcefield of type x. If the source field has a length of 0, the target field is assigned the value 0.


Example

The result of the following conversion has the value 123456789. The first three bytes FFFFFF of the source field are ignored.

DATA hex TYPE xstring VALUE 'FFFFFF075BCD15'. 

DATA(result) = CONV i( hex ). 

Character-Like Target Fields

Target Conversion
c Content is handled in the same way as a sourcefield of type x. If the length of the source field is 0, the target field is filled with blank characters.
n Content is handled in the same way as a sourcefield of type x. If the length of the source field is 0, the target field is padded with the character "0".
string Content is handled in the same way as a sourcefield of type x. If the length of the source field is 0, the length of the target field is also 0 after the assignment.


Example

The string produced by the conversion is FFFFFF075BCD15. All bytes of the source field are included in the conversion.

DATA hex TYPE xstring VALUE 'FFFFFF075BCD15'. 

DATA(result) = CONV string( hex ). 

Byte-Like Target Fields

Target Conversion
x Content is handled in the same way as a sourcefield of type x. If the length of the source field is 0, the target field is filled with the hexadecimal 0.
xstring Content is handled in the same way as a sourcefield of type x. If the length of the source field is 0, the length of the target field is also 0 after the assignment.


Example

The byte chain produced by the conversion is FFFFFF075BCD15. All bytes of the source field are included in the conversion.

DATA hex TYPE xstring VALUE 'FFFFFF075BCD15'. 

DATA(result) =  hex. 

Date/Time Fields as Target Fields

‎Target Conversion
d Content is handled in the same way as a sourcefield of type x. If the length of the source field is 0, the target field is padded with the character "0".
t Content is handled in the same way as a sourcefield of type x. If the length of the source field is 0, the target field is padded with the character "0".
utclong Not supported. Produces a syntax error or raises the exception CX_SY_CONVERSION_NOT_SUPPORTED.


Example

The value of the date field resulting from the conversion is 20170111 corresponding to 736341 days since 01/01/0001. The first three bytes FFFFFF of the source field are ignored.

DATA hex TYPE xstring VALUE 'FFFFFF000B3C55'. 

DATA(result) = CONV d( hex ).