ABAP Keyword Documentation → ABAP - Reference → Assignments → Assignment 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 transferred, the field is filled 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-Type Target Fields
Target | Conversion |
---|---|
x |
The content of the source field is converted first to data type i (seeabove) and then to type x (see conversion table for source field type i ,(b , s )). |
xstring |
The content of the source field is converted first to data type i (seeabove) and then to type xstring (see conversion table for source field type i ,(b , s )). |