WRITE - Predefined Output Formats

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

Output Length and Alignment

The default settings for the output length and alignment of the predefined ABAP types are listed in the following table:

Data type Output length Alignment
c Length of dobj, max. 255 left-aligned
d 8 left-aligned
f 24 right-aligned
i 11 right-aligned
n Length of dobj, max. 255 left-aligned
p 2 x length of dobj (+ 1 if there is a decimal separator) right-aligned
string In non-Unicode programs, this is the number of characters in dobj. In Unicode programs it is the number of columns required in the list. If this is greater than the number of characters in dobj, superfluous characters are filled with blanks when they are written to the list buffer. If the output is left-justified, they are filled on the right, if it is right-justified they are filled on the right, and if the output is centered, they are filled on the right and left in alternation. left-justified
t 6 left-justified
x 2 x length of dobj, max. 255 left-justified
xstring 2 x number of bytes contained left-justified

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

Note

When the implicit output length is used, fewer characters may be displayed in the list than are stored in the list buffer. This can happen to all data objects except those of the type string. In the case of data objects of the type string and text field literals, it is assumed that all the characters are to be displayed. For this reason, the implicit output length is calculated according to the characters in the data object so that it corresponds to the number ofcolumns required in the list. Any blanks appended in the list buffer during this process are cut off again when the data is written to the actual list.

Formats from the ABAP Dictionary

You can define a different output length and a conversion routine for the domain for data objects whose data types are defined with reference to the ABAP Dictionary. The output length specified there is used instead of the implicit output length from the above table. It is not possible to define an output length in the ABAP Dictionary for the data types RAWSTRING, SSTRING, and STRING, so that the length specified in the above table always applies here.

Decimal Separators, Date and Time Format

The format in which decimals are displayed (selection of decimal and thousand separators) and the date format are specified in the user master record. You can change these settings using a SET COUNTRY statement.

Data objects of the type d are displayed according mask defined in the user master record. The separators are displayed if the available output length is sufficient. The predefined output length displayed in the table above is not sufficient.

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

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

Character-like data objects are displayed according to the codepage. Unicode systems can contain characters that occupy more columns in the list than storage positions in the list buffer.

Byte-like data objects are displayed in hexadecimal form in which one byte is displayed by two characters.

In the numeric data types i and p, the field on the far right is reserved for the plus/minus sign. The field displays a minus sign for negative values and a blank for positive values. The thousand separators defined in the user master record are displayed if the available output length is sufficient.

A type f data object is displayed in scientific notation preceded by a plus/minus sign (blank for positive numbers), a position before the decimal separator, a maximum of 16 fractional portions, the character "E" and a three-character exponent with a plus or minus sign.

Formats for Lines

The characters "-" and "|" are replaced by corresponding line elements if they are output immediately one after the other, either horizontally or vertically. Line elements are horizontal and vertical lines, corners, crosses, and t-bars. The characters are replaced with solid lines. A single "|" is always replaced with a vertical line. Replacement with line elements takes place relative to display in the list and not relative to the definition in the list buffer. This means the characters "-" and "|" can be linked to form lines in Unicode systems even if they are not specified one after the other in the list buffer.