ABAP Keyword Documentation →  ABAP - Reference →  User Dialogs →  Classic Lists →  Create lists →  WRITE → 

WRITE - Output Length

When data is written with a WRITE statement, the output is stored in the list buffer and accessed from there for display when the list is called.

Each time a data object is output with a WRITE statement, an output length is defined, either implicitly (according to the table below), or explicitly (if len is specified after the addition AT). The output length defines the following:

Predefined Output Lengths

If the output length is not specified explicitly, it is set for predefined ABAP types as shown in the following tables:

Notes

Numeric Data Types

Data Type Output length
b 3
s 5
i 11
p 2 x length of dobj (+ 1, if there is a decimal separator)
decfloat16 24
decfloat34 46
f 24

Note

The predefined output length specified in the table above for the type s is not sufficient to display the sign for a 5-digit number. With type i the length is sufficient for numbers without decimal separators.

Character-like data types

Data Type Output Length
c Length of dobj, maximum 255
string In non-Unicode programs, the number of characters contained in dobj. In Unicode programs the number of columns needed in the list. If this is greater than the number of characters in dobj, the surplus positions are filled with empty spaces during writing in the list buffer. The filling takes place to the right of left-justified outputs, to the left of right-justified outputs and by turns to the right and to the left of centered outputs.
n Length of dobj, maximum 255
d 8
t 6

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

Notes

Byte-Like Data Types

Data Type Output Length
x 2 x length of dobj, maximum 255
xstring 2 x number of bytes contained

Note

For the data type RAWSTRING, it is not possible specify an output length in the ABAP Dictionary and the lengths given in the table above always apply.

Output Length in List Buffer

If the output length is shorter than the length of the data format specified for the data object or defined using int_format_options, the output is shortened in accordance with the cutoff behavior described in WRITE ... TO.

If the output length is greater than the length of a predefined or user-defined format, this output length is filled in the list buffer and output is arranged there according to the predefined or user-defined alignment. Space that is not required is filled with blanks.

Output Length in the List

When displaying or printing a list, the content stored in the list buffer is transferred to the list as follows:

Class for Calculating Output Lengths

The methods of the system class CL_ABAP_LIST_UTILITIES can be used to calculate output lengths in the list buffer and in list display. The return values of these methods can be used to program a correct column alignment for ABAP lists, even if they contain characters that require more than one column.