1. PRINT-CONTROL.
2. PRINT-CONTROL INDEX-LINE f.
PRINT-CONTROL.
1. ... CPI
cpi
2. ...
LPI lpi
3. ...
SIZE size
4. ...
COLOR
...
BLACK
...
RED
...
BLUE
...
GREEN
...
YELLOW
...
PINK
5. ...
LEFT MARGIN col
6. ...
FONT font
7. ...
FUNCTION f
8. ...
LINE line
9. ... POSITION col
Determines the desired print format (see printing in ABAP) for the subsequent characters, starting from the current output position.
You define the output position either implicitly:
or explicitly:
With output to the screen or when printing screen output, the statement has no effect.
Furthermore, the PRINT-CONTROL statements must be repeated
by the application program at the beginning of each new page to ensure that they are applied. This is
because the list processor inserts COLxx print controls in the spool for the current format at the start
of each page, and these can deactivate existing print control statements. The list processor does not
store PRINT-CONTROL statements originating from the application program once it has placed them in the spool.
... CPI cpiLetters per inch
... LPI lpiLines per inch
... SIZE sizeScript size
... COLORColor ...
...
BLACK
black
... REDred
...
BLUE
blue
... GREENgreen
... YELLOWyellow
... PINKpink
... LEFT MARGIN colDistance from left edge
... FONT fontSet font
... FUNCTION fReference function
directly as sub-
argument of Table T022D
Sets the specified print format for the subsequent characters, starting from the current output position.
PRINT-CONTROL SIZE 2 COLOR BLACK FONT 5.
... LINE line
Explicitly sets the output line of the current page from which you want the PRINT-CONTROL options to take effect (from column 1).
... POSITION col
Explicitly sets the column of the line specified by the addition "LINE"
from which you want the print options to take effect. If the addition "LINE" is missing, the current line is assumed.
You must always use additions 8 and 9 in conjunction with one of the additions 1 to 7. They have no
effect on the current line number (SY-LINNO) or column
number (
SY-COLNO). You can thus also use the PRINT-CONTROL
statements after all WRITE statements for the current page.
WRITE: /.
PRINT-CONTROL FUNCTION 'PRCTL'.
WRITE : / 'Test print control'.
NEW-LINE.
WRITE: / 'Old print control still in effect'.
The spool output in hexadecimal form:
#PRCTLTest print control
Old print control still in effect
WRITE : /.
PRINT-CONTROL FUNCTION 'SBP01'.
WRITE : '123456789'.
PRINT-CONTROL FUNCTION 'SBS01'.
The spool output in hexadecimal form:
#SBP01123456789 #SBS01
You can use this sequence of statements to print bar codes.
Conversion to machine-specific control characters is performed via tables
TSP03 and T022D:
+===================+==============================+
I
Option I Argument for table
I T022D I
+===================+======================+=======+
I CPI 'xxx'
I Printer name (TSP03) I CIxxx I
+-------------------+----------------------+-------+
I LPI
'xxx' I Printer name (TSP03) I LIxxx I
+-------------------+----------------------+-------+
I SIZE 'xxx' I Printer name (TSP03) I SIxxx I
+-------------------+----------------------+-------+
I FONT 'xxx' I Printer name (TSP03) I FOxxx I
+-------------------+----------------------+-------+
I COLOR BLACK I Printer name (TSP03) I CO001 I
+-------------------+----------------------+-------+
I COLOR RED I Printer name (TSP03) I CO002 I
+-------------------+----------------------+-------+
I COLOR BLUE I Printer name (TSP03) I CO003 I
+-------------------+----------------------+-------+
I COLOR GREEN I Printer name (TSP03) I CO004 I
+-------------------+----------------------+-------+
I COLOR YELLOW I Printer name (TSP03) I CO005 I
+-------------------+----------------------+-------+
I COLOR PINK I Printer name (TSP03) I CO006 I
+-------------------+----------------------+-------+
I LEFT MARGIN 'xxx' I Printer name (TSP03) I LMxxx I
+-------------------+----------------------+-------+
I FUNCTION 'yyyyy' I Printer name (TSP03) I yyyyy I
+-------------------+----------------------+-------+
If (according to table TSP03) a particular printer type
does not support a particular option in table T022D (i.e.
there is no entry), this option is ignored when printing. For further details, please refer to the documentation
for tables TSP03 and T022D.
PRINT-CONTROL INDEX-LINE f.
Ouputs the contents of the field f as an index line in the current print output. An index line usually contains only administration information for archiving and is not output when printing. If no print mode is active, the statement has no effect. If the WRITE statement has already begun a print line, the index line is output after this line.
DATA: INDEX_LINE(200).
PRINT-CONTROL INDEX-LINE INDEX_LINE.
Print Control