Predefined Output Formats of the WRITE Statement

The predefined output format depends on the data type and user-specific default settings.

Output Length and Alignment

The following table lists the default settings for output length and alignment of the built-in ABAP types:

Data Type Output Length Alignment
c Length of dobj, max. 255 Left
d 8 Left
f 24 Right
i 11 Right
n Length of dobj, max. 255 Left
p 2 x length of dobj (+ 1, if there is a decimal separator) Right
string In non-Unicode programs, the number of characters in dobj. In Unicode programs, the number of columns required in the list. If this number is greater than the number of characters in dobj, surplus spaces are filled with blanks when writing to the list buffer. In the case of left-aligned output, the system fills on the right, for right-aligned output on the left, and for centred output right and left alternately. Left
t 6 Left
x 2 x Length of dobj, max. 255 Left
xstring 2 x Number of contained bytes Left

In Unicode-programs, the output length of text field literals is set like that of data objects of the data type string. The actual data type (c) is only taken into account in non-Unicode programs.

Note

For all data objects, other than those of the type string and text field literals, using the implicit output length can result in fewer characters being displayed in the list than are stored in the list buffer. In the case of data objects of the data type string and text field literals, it is assumed that all characters are to be displayed. Therefore, the implicit output length is calculated on the basis of the characters contained in the data object in such a way that it corresponds to the number of columns required in the list. Any blank characters that are appended in the list buffer are truncated when writing to the actual list.

Formats from the ABAP Dictionary

For data objects whose data types are defined with reference to the ABAP Dictionary, a different output length and a conversion routine can be specified for the relevant domain. The output length specified here is used instead of the implicit output length in the table above. You cannot specify an output length in the ABAP Dictionary for the data types RAWSTRING, SSTRING, and STRING and the length specified in the above table always applies.

Decimal Separators, Date and Time Format

The decimal display format (decimal and thousand separators) and the date format are defined in the user master record. You can change these settings using the SET COUNTRY statement.

Data objects of the type d are displayed in accordance with the template defined in the user master record. The separators are displayed if the output length is sufficient. The predefined output length in the above table is insufficient.

In the case of data objects of the type t, colons are displayed as separators between hours, minutes, and seconds if the output length is sufficient. The predefined output length in the above table is insufficient.

Formats for Character-Type, Byte-Type, and Numeric Data Objects

Character-type data objects are displayed according to the codepage. In Unicode systems, there can be characters that occupy more columns in the list than memory spaces in the list buffer.

Byte-type data objects are displayed in hexadecimal format, where two characters represent one byte.

In the case of the numeric data types i and p, the field on the extreme right is reserved for the prefix. For negative values, a minus sign (-) is displayed in this field and for positive values a blank space. If the output length is sufficient, the thousand separators defined in the user master record are displayed.

A data object of the type f is displayed in scientific notation with a preceding prefix (blank for positive numbers), a space before the decimal separator, a maximum of 16 decimal places, the character "E", and a three-digit exponent including prefix.

Line Formats

The characters "-" and "|" are replaced with suitable line elements if they are displayed directly next to or above one another. Line elements are horizontal and vertical lines, corners, crosses, and T-shapes. The characters are replaced so that continuous lines are created. A single "|" is always replaced with a vertical line. The replacement with line elements is carried out according to the list display and not the definition in the list buffer. In Unicode systems, the characters "-" and "|" can therefore be connected to form continuous lines, even if they are not directly adjacent in the list buffer.