Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Character String and Byte String Processing →  Expressions and Functions for String Processing →  string_exp - String Expressions →  string_exp - String Templates →  String Templates - embedded_expressions 

Embedded Expressions - Predefined Formats

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

Other versions: 7.31 | 7.40 | 7.54

Text length

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

Alignment

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

Character-type data types

For all character-type data types with fixed lengths (c, d, n, and t), the full content is used except for any closing blanks. The content of text strings with the type string is used in full.


Note

Unlike in WRITE TO, no formatting is applied for the data types d and t and no separators are inserted.

Byte-like data types

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

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 thousand separators are inserted.

The following applies to the individual numeric data types:

  • Values with the data types decfloat16 and decfloat34 are formatted by default in mathematical notation, without an exponent. You can use the formatting option EXPONENT to represent the exponent. In the standard setting, closing zeros are not displayed in the decimal places. To display a given number of decimal places, you can use formatting option DECIMALS..
  • Values with the data type f are formatted by default in mathematical notation, without an exponent. You can use the formatting option EXPONENT to represent the exponent. Following zeros in the decimal place positions are not usually displayed. You can use the formatting option DECIMALS to display the numbers of decimal places that you want.