Target | Conversion |
c | The characters in the source field are inserted in the target field, left-aligned. Trailing spaces in the source field are not transferred. If the target field is longer than the number of characters transferred, it is filled with blank characters to the right. If the target field is shorter, the number is truncated from the right. |
d | The same conversion rules apply as to a field of type c of length 8. If the source field does not contain a valid date in the first eight characters, in the format YYYYMMDD, an invalid date is created in the target field. |
f | The source field must contain a number in scientific notation. Exception: A source field that contains only blank characters is interpreted as the number zero. mathematical or commercial notations are not allowed, unless they can be interpreted as scientific notation. If the mantissa contains more than 17 digits, surplus digits are rounded up or down. If the number lies within the value range of data type f, it is converted into the internal representation of a floating point number, otherwise a treatable exception is raised. |
i, b, s | The source field must contain a number in mathematical or commercial notation. Exception: A source field that contains only blank characters is interpreted as the number zero. Scientific notation is not allowed, unless it can be interpreted as mathematical notation. Decimal placesare rounded to whole-numbered values. If the number lies within the value range of data types i, b or s, it is converted into the internal representation of an integral number, otherwise a treatable exception is raised. Prior to release 6.10, an exception is also raised when the source field was specified as the text field literal '-2147483648' |
n | The characters in the source field that represent digits are inserted in the target field, right-aligned. Other characters are ignored. If the target field is longer than the number of digits in the source field, it is filled to the left with the character "0". If the target field is shorter, the number is truncated from the left. |
p | The source field must contain a number in mathematical or commercial notation. Exception: A source field that contains only blank characters is interpreted as the number zero. Scientific notation is not allowed, unless it can be interpreted as a mathematical notation. Decimal places are rounded to the number of decimal places in the target field. If the number lies within the value range of the data type of the target field, it is converted into the internal representation of a packed number. Otherwise a treatable exception is raised. |
string | The characters in the source field are inserted in the target field, left-aligned. Trailing spaces in the source field are not transferred. The length of the target field is determined by the number of characters transferred. |
t | The same conversion rules apply as to a field of type c with the length 6. Exception: Trailing spaces are transferred and if the target field is longer than the number of characters transferred, the field is filled to the right with the "0" character. |
x | The characters in the source field are interpreted as the representation of the value of a half-byte in hexadecimal representation. If the valid characters "0" to "9" and "A" to "F" appear, the corresponding half-byte value is transferred to the memory of the target field, left-aligned. If the target field is longer than the number of half-bytes transferred, it is filled to the right with the hexadecimal 0. If it is too short, the number is truncated to the right. The first invalid character terminates the conversion from the position of this character and the half-bytes not filled up to that point are filled with the hexadecimal 0. |
xstring | The same conversion rules apply as to a field of type x. Half-bytes are transferred to the target field, and the length of the target field is determined by the number of valid characters in the source field. If number of valid characters in the target field is odd, the last remaining half-byte in the target field is filled with the hexadecimal 0. |
In ABAP, the trailing spaces in source fields of type c are ignored, by default. An assignment from source type c to target type t is an exception to this rule. In order to assign source fields of type c to target fields (particularly source fields of type string) and include the trailing blanks, you can use the RESPECTING BLANKS addition to the CONCATENATE statement.