Ansicht
Dokumentation

ABENSTRING_TEMPLATES_PREDEF_FORMAT - STRING TEMPLATES PREDEF FORMAT

ABENSTRING_TEMPLATES_PREDEF_FORMAT - STRING TEMPLATES PREDEF FORMAT

PERFORM Short Reference   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- Predefined Formats

The following predefined formatting rules apply to embedded expressions in string templates. These rules can be overridden by explicit formatting options format_options.

Text Length

The predefined text length is the minimum length required to represent the entire result of the embedded expression.

Note

The predefined text length can be overridden using the formatting option WIDTH.

The length of the result of the following string template is 5. It consists of 4 digits and a decimal separator.

Alignment

The predefined alignment for all data types is left-aligned.

Note

The predefined alignment can be overridden using the formatting option ALIGN.

The following string template creates the character string shown below it.

1    2    3    -

Character-Like Data Types and Date/Time Types

For character-like data types with fixed lengths (c and n) and the date/time types (d, t), the content is passed ignoring trailing blanks. The content of text strings with the type string is passed completely.

Note

Unlike in WRITE TO, no formatting is applied to the data types d and t and no separators are inserted if no formatting options are specified explicitly.

Example

The following string template creates the character string shown below, depending on the date and time. The format is independent of the formatting settings.

20160909 081545

Byte-Like Data Types

Values of the byte-like data types x and xstring are formatted in hexadecimal format, where one byte is represented by two characters.

The following string template creates the character string shown below it.

48656C6C6F20576F726C6421

Numeric Data Types

The following rules apply to the representation of numeric values:

  • For negative values, the minus sign is placed on the left of the number, without a blank. No sign is placed in front of positive numbers by default.
  • The period (.) is always used as the decimal separator.
  • No thousands separators are inserted.

The following applies to the individual numeric data types:

  • Values of data type (b, s), i, int8, and p are formatted in mathematical notation and all decimal places are considered.
  • Values with the data types decfloat16 and decfloat34 are formatted by default in mathematical notation, that is, without an exponent. The formatting option EXPONENT can be used to represent the exponent. Trailing zeros in decimal places are not displayed by default. The formatting option DECIMALS can be used to determine the required number of decimal places.
  • Values with the data type f are formatted by default in mathematical notation, without an exponent. The formatting option EXPONENT can be used to represent the exponent. Trailing zeros in decimal places are not displayed by default. The formatting option DECIMALS can be used to determine the required number of decimal places.

The following string template creates the string below, with a platform-dependent result for the data type f. If the conversion operator is not specified, the calculation type of the embedded expression is i.

-1, -0.6666666666666666666666666666666667, -0.66666666666666663

Time Stamp Type

A valid time stamp in a time stamp field with the time stamp type utclong is formatted as "yyyy-mm-dd hh:mm:ss.fffffff" in accordance with the SQL standard ISO 9075. A blank is placed between the date and time and the period (.) is used as the default decimal separator. An initial time stamp field is represented by a string of 27 blanks. A time stamp field whose value is greater than or equal to the last second or is between "9999-12-31 23:59:59.0000000" and "9999-12-31 23:59:59.9999999" is represented as "9999-12-31 23:59:59.9999999".

This setting can be overwritten using formatting options such as TIMESTAMP, COUNTRY, or DECIMALS.

The following string template creates the character string shown below it.

2019-04-02 10:30:12.3456789






ABAP Short Reference   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 7242 Date: 20240425 Time: 161524     sap01-206 ( 89 ms )