The WRITE Statement
The basic ABAP statement for outputting data on the screen is WRITE.
Syntax
WRITE <f>.
This statement outputs the field <f> to the current list in its standard output format. By default, the list is displayed on the screen.
The field <f> can be

You can print the current output list directly from the output screen by choosing Print.
If a selection screen is defined for the program (see

PROGRAM SAPMZTST.
WRITE 'Hello, here I am!'.
When you start this program, the system leaves the current screen (this may be the ABAP Editor: Initial Screen) and branches to the output screen as follows:

The output screen has the same name as the title of the program specified in the program attributes (see
Maintain Program Attributes).The first line on the screen contains the list header. By default, the list header is the same as the title of the program. However, you can maintain the list header independently from the program title outside the actual program. For further information about this, see
Working with Text Elements. The current page number (1) appears on the right.The list header is followed by one horizontal line and then the output is displayed.
You can choose Search to search for specific patterns.
On the screen, the output is normally left-justified. If you use several WRITE statements, the output fields are displayed one after the other, each separated by one column (i.e. one blank). If there is not enough space for an output field on the current line, a new line is started.

PROGRAM SAPMTEST.
TABLES SPFLI.
.............
WRITE: 'COMPANY: ', SPFLI-CARRID.
Note the use of the colon and the commas (see
Syntax Structure).The program fragment in this example outputs two fields, the literal 'COMPANY: ' and the component CARRID of the table work area SPFLI, to the screen:
COMPANY: AA
The format of data fields on the output screen depends on their data type (see
Elementary Data Types - Predefined).Output format of predefined data types
Data type |
Output length |
Positioning |
C |
field length |
left-justified |
D |
8 |
left-justified |
F |
22 |
right-justified |
I |
11 |
right-justified |
N |
field length |
left-justified |
P |
2 * field length (+1) |
right-justified |
T |
6 |
left-justified |
X |
2 * field length |
left-justified |
The numeric data types F, I, and P are right-justified and padded with blanks on the left. If there is sufficient space, thousands separators are also output. If a type P field contains decimal places, the default output length is increased by one.

With the data type D, the internal format of a date differs from its output format. When you use the WRITE statement for outputting data, the system automatically outputs dates of type D in the format specified in the user’s master record (e.g. DD/MM/YYYY or MM/DD/YYYY).

PROGRAM SAPMTEST.
DATA NUMBER TYPE P VALUE '-1234567.89' DECIMALS 2.
WRITE: 'Number', NUMBER, 'is packed'.
The output appears as follows:
Number 1,234,567.89- is packed
The field NUMBER has a total length of 13, i.e. 9 digits (including the decimal point), the leading minus sign, and two commas as separators. The output length of the NUMBER field is 2*8+1=17 because the field length of a type P field is 8. The superfluous positions are filled with four blanks. This means that there are five blanks between the literal 'Number' and the number itself.