Ansicht
Dokumentation

ABENCONVERSION_TYPE_N - CONVERSION TYPE N

ABENCONVERSION_TYPE_N - CONVERSION TYPE N

General Data in Customer Master   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

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 like character-like objects, and when assigned to numeric data objects they behave numerically. Valid data for data objects of type n is in the form of digit-only strings. When assigning valid data to numeric data objects, the numeric value of the string of digits is assigned to the target object. The conversion rules, however, also allow the assignment of numeric text fields that contain invalid data. The latter is not recommended.

Numeric Target Fields

Target Conversion
i, int8, (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.

The result of the following conversion has the value 0.

Character-Like Target Fields

Target Conversion
c Content is handled in the same way as a source field of type c
n The characters in the source field are passed right-aligned to the target field. Trailing blanks are passed. If the target field is longer than the characters passed, the field is padded with "0" characters on the left. If the target field is shorter, the characters are cut off on the left.
string Content is handled in the same way as a source field of type c

The string resulting from the conversion is 0000001234.

Byte-Like Target Fields

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

The byte chain resulting from the conversion is 04D2.

Date/Time Fields as Target Fields

Target Conversion
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
utclong Not supported. Produces a syntax error or raises the exception CX_SY_CONVERSION_NOT_SUPPORTED.

The value of the date field resulting from the conversion is the unchanged value 20000101 of the source field.






General Data in Customer Master   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 5840 Date: 20240418 Time: 234053     sap01-206 ( 77 ms )