Ansicht
Dokumentation

ABENCONVERSION_TYPE_STRING - CONVERSION TYPE STRING

ABENCONVERSION_TYPE_STRING - CONVERSION TYPE STRING

BAL_S_LOG - Application Log: Log header data   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

Source Field Type string

Numeric Target Fields

Target Conversion
i, int8, (b, s) Content is handled in the same way as a source field of type c. 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 source field of type c. 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 source field of type c. 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 source field of type c. If the source field has a length of 0, the target field is assigned the value 0.

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

Character-Like Target Fields

Target Conversion
c The content is handled in the same way as a source field of type c, with the difference that trailing blanks are passed. If the length of the source field is 0, the target field is padded with blanks.
n The content is handled in the same way as a source field of type c If the length of the source field is 0, the target field is padded with the character "0".
string No conversion takes place. After the assignment, the internal reference of the target field points to the same string as the source field. A new string is only created in the memory if a change request for the content of the source field or target field is submitted.

Notes

  • In ABAP, the trailing blanks are respected for source fields of type string but not for data objects of type c.
  • If characters are truncated on the right when character strings containing non-Unicode double-byte characters are assigned, then such a character can be divided in the middle, which generally produces an invalid character at the right margin. To prevent this, the method CL_SCP_LINEBREAK_UTIL=>STRING_SPLIT_AT_POSITION can be used.

The string resulting from the assignment is "abcd    " with length 8. The trailing blanks of the literal with type string and length 8 are respected.

Byte-Like Target Fields

Target Conversion
x The content is handled in the same way as a source field of type c If the length of the source field is 0, the target field is padded with hexadecimal 0.
xstring The content is handled in the same way as a source field of type c If the length of the source field is 0, the length of the target field is also 0 after the assignment.

The byte chain resulting from the conversion is FFFF0000.

Date/Time Fields as Target Fields

Target Conversion
d The content is handled in the same way as a source field of type c, with the difference that trailing blanks are passed. If the length of the source field is 0, the target field is padded with the character "0".
t The content is handled in the same way as a source field of type c and, in particular, the trailing blanks are passed. If the length of the source field is 0, the target field is padded with the character "0".
utclong The content is handled in the same way as a source field of type c and, in particular the trailing blanks are ignored. An initial source field and a source field that contains only blanks produce the initial value of a time stamp field.

The value of the date field resulting from the conversion is 00000000. If, on the other hand, a text field of type c containing only blanks is converted, this produces a target field containing eight blanks, despite the cutting off of all trailing blanks.

Example

Conversion of a text string composed of date and time specifications in ISO format 8601 to a time stamp in a time stamp field.






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

Length: 7330 Date: 20240418 Time: 220012     sap01-206 ( 63 ms )