Professional Documents
Culture Documents
Write Operation
WRITE (see transaction LIBS for SAP guidelines using colors, symbols, icons etc. in
lists):
WRITE <f> [ <formatting options>].
<f> can be:
any data object (variable, literal, constant);
field symbol or formal parameter;
text symbol like text-<nnn> or 'default text'(<nnn>), where <nnn> is text
symbol's Id.
Type-specific output (len=field length):
Type Standard output length Justified
C len left
D 8 left
F 22 right
I 11 right
N len left
P 2*len[+1] right
T 6 left
X 2*len left
Positioning output on the screen:
WRITE AT [/][<pos>][(<len>)] <f>.
<f> can be:
/ - new line;
<pos>, <len> - numbers or variables up to 3 digits;
AT can be omitted if <pos>, <len> are not variables.
If <len> is too short, fewer characters are displayed. Numeric fields are truncated on the
left and prefixed with an asterisk (*). All other fields are truncated on the right, but no
indication is given that the field is shorter.
SKIP [<n>].
SKIP TO LINE [<n>].
Note. WRITE / ' '. statement does not output blank line by default. To change default
setting use following statement:
SET BLANK LINES ON|OFF.
Outputting field content as checkbox:
WRITE <f> AS CHECKBOX.
If the first character of <f> is an "X", the checkbox is displayed filled. If the first
character is SPACE, the checkbox is displayed blank. The checkboxes that are created by
this statement are input enabled by default.
Outputting lines on the screen:
WRITE <f> AS LINE.
On list output, automatically links certain characters together to form continuous lines or
boxes, if there is no space between them:
vertical lines, output with the system field SY-VLINE or using a field with the
contents "|" (vertical line);
horizontal lines, output with the system field SY-ULINE or using a field with at
least 2 consecutive minus signs "--".
Exactly how each line segment is output (e.g. whether as straight line, corner, T-piece or
cross) depends on the adjoining characters.
The include <LINE> (or the more comprehensive include <LIST>) contains the relevant
identifiers for lines as constants, e.g. LINE_TOP_LEFT_CORNER,
LINE_BOTTOM_MIDDLE_CORNER.
FORMAT:
FORMAT <option1> [ON|OFF] <option2> [ON|OFF] ... .
FORMAT <option1>=<var1> <option2>=<var2> ... .
Effective from next output (WRITE or new line) operation until next event or turning
OFF. ON = default. <vari> should be of type I. If the <vari>=0, the variable has the same
effect as the OFF option. If WRITE statement follows the FORMAT statement, the
settings of the WRITE statement overwrite the corresponding settings of the FORMAT
statement for the current output.
FORMAT COLOR <n> [ON] INTENSIFIED [ON|OFF] INVERSE [ON|
OFF].
Does not work for lines. If INVERSE is used, the INTENSIFIED has no effect. Has no
effect on input fields.
Call the SHOWCOLO report in any system for demonstration of colors in lists.
SUMMARY. this is equivalent to FORMAT INTENSIFIED ON.
DETAIL. this is equivalent to FORMAT INTENSIFIED OFF.
FORMAT HOTSPOT [ON|OFF].
Affects the display format of the mouse pointer and the effect of the mouse single click:
If you drag the mouse pointer over list areas which are output with the format
...HOTSPOT (lines or fields), the mouse pointer switches from its standard display
format (usually an arrow) to the format of a hand with an outstretched index finger. If you
then click once, the effect is like double-clicking or pressing the function key F2 (AT
LINE-SELECTION). Has no effect on input fields.
FORMAT INPUT [ON|OFF].
Determines whether the user can enter data. See READ LINE.
FORMAT RESET.
The same as FORMAT COLOR OFF INTENSIFIED OFF INVERSE OFF
HOTSPOT OFF INPUT OFF.
Define Structure
List Width:
REPORT <report> LINE-SIZE <n>.
n=0 : standard list. List cannot be wider than 255 (132 for most printers). SY-LINSZ
contains the current line size.
To adapt the line size to the current window width, set <n> to SY-SCOLS. SY-SCOLS
contains the number of characters of a line of the current window.
Page Length:
REPORT <report> LINE-COUNT <length>[(<n>)].
n - number of reserved for footer lines. length=0 : standard list. SY-LINCT contains the
current page length or 0 if standard page.
To adapt the page length to the current window length, set <length> to SY-SROWS. SY-
SROWS contains the number of lines of the current window.
Individual Page Header:
REPORT <report> [NO STANDARD PAGE HEADING].
....
TOP-OF-PAGE [DURING LINE-SELECTION].
WRITE... .
List processing event that is executed before the first data is output on a new page.
Without the addition ... DURING LINE-SELECTION, processed only when generating
basic lists, not when creating secondary lists. Only executed before outputting the first
line on a new page - not triggered by a NEW-PAGE statement.
During the event TOP-OF-PAGE, you can also fill the system fields SY-TVAR0...SY-
TVAR9 with values that should replace eventual placeholders &0...&9 in the standard
page header.
Individual Page Footer:
REPORT <report> LINE-COUNT <length>(<n>).
....
END-OF-PAGE.
WRITE... .
END-OF-PAGE processed only if n>0. If you explicitly specify a new page with NEW-
PAGE, END-OF-PAGE is ignored.
Page Break:
NEW-PAGE [PRINT ON ...].
ends the current page and increased SY-PAGNO by 1;
does not trigger the END-OF-PAGE event.
NEW-PAGE [NO-TITLE|WITH-TITLE] [NO-HEADING|WITH-HEADING].
used to suppress or display the standard header and/or columns headers on all
pages to come. default both: WITH for basic and NO for secondary lists;
does not affect the display of a page header defined at the event TOP-OF-PAGE.
NEW-PAGE LINE-COUNT <length>.
length=0 : standard list. Can be variable.