Skip to content

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 n

The conversion rules are designed in such a way that when data objects of type n are assigned to character-like data objects they behave as character-like data objects. Valid data for data objects of type n is in the form of pure character strings. When assigning valid data to numeric data objects, the numeric value of the character string is assigned to the target object. The conversion rules, however, also allow assignment of numeric text fields that contain invalid data. The latter is not recommended.

Other versions: 7.31 | 7.40 | 7.54

Numeric Target Fields

Target Conversion
i, (b, s) Content is handled in the same way as a source field of type c
p Content is handled in the same way as a source field of type c
decfloat16, decfloat34 Content is handled in the same way as a source field of type c
f Content is handled in the same way as a source field of type c


Note

  • The CL_ABAP_DECFLOAT class contains the methods READ_DECFLOAT34 and READ_DECFLOAT16, to convert character strings into floating point numbers. The exceptions of these methods are more significant than those of a normal assignment. Furthermore, the methods return a return value that reveals information about the roundings carried out.

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, right-aligned. Trailing blanksare copied. If the target field is longer than the characters passed, the field is padded with "0" characters from the left. If the target field is shorter, the characters are cut off from the left.
d Content is handled in the same way as a source field of type c
t Content is handled in the same way as a source field of type c

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)).