To determine the print format, use the PRINT-CONTROL statement:
Syntax
PRINT-CONTROL <formats> [LINE <lin>] [POSITION <col>].
Without using the options LINE and POSITION, this statement sets the print format specified in <formats> for all characters that are printed starting from the current output position (system fields SY-COLNO and SY-LINNO). The LINE option sets the print format to start from line <lin>. The POSITION option sets the print format to start from column <pos>.
In <formats>, you can specify several different print formats. The system converts the values into a printer-independent code, the so-called print-control code. When printing, the system translates the print-control code to printer-specific control characters of the selected printer.
The table below lists the valid <formats> options and the corresponding print-control codes:
<formats> |
Code |
Meaning |
CPI <cpi> |
CI<cpi> |
Characters per inch |
LPI <lpi> |
LI<lpi> |
Lines per inch |
COLOR BLACK |
CO001 |
Color black |
COLOR RED |
CO002 |
Color red |
COLOR BLUE |
CO003 |
Color blue |
COLOR GREEN |
CO004 |
Color green |
COLOR YELLOW |
CO005 |
Color yellow |
COLOR PINK |
CO006 |
Color pink |
LEFT MARGIN <lfm> |
LM<lfm> |
Space from the left margin |
FONT <fnt> |
FO<fnt> |
Font |
FUNCTION <code> |
<code> |
For directly specifying a code |
There are many more print-control codes than <formats> options. Therefore, you can specify any print-control code directly using the FUNCTION option.
Use the print formats only to set formats that are either not possible or not reasonable when formatting output for the output screen (for example, size specifications or fonts). You should set all other formats as described in
To find the codes supported by a certain printer, choose Tools
® Administration ® Spool ® Spool administration. This takes you to the screen Spool Administration (transaction SPAD).Choose the individual components to receive the following information:
Choose |
Information |
Output devices |
a list of the installed printers, including the device types |
Device types |
a description of the device types |
Standard print control |
a list of the print-control codes |
Print control |
an assignment of printer-specific control characters to the print-control codes for each device type |
Page formats |
a list of page formats |
Paper types |
a list of valid formats |
Device initialization |
an assignment of formats for each device type |
Display Print control to find the print-control codes available for the printer you want to use. From the displayed list, select the desired device type.
Here you can see whether printer-specific control characters are maintained for a print-control code. Choose Info to display additional information for the individual codes in a dialog window.
For more comprehensive information about spool administration, refer to the
SAP Printing Guide (BC-CCM-CRM).The following executable program (report) is connected to the logical database F1S.
REPORT demo_list_print_control LINE-SIZE 60.
TABLES spfli.
PRINT-CONTROL FUNCTION: 'SABLD' LINE 1,
'SAOFF' LINE 2,
'SAULN' LINE 3.
GET spfli.
WRITE: / spfli-carrid, spfli-connid, spfli-cityfrom,
spfli-airpfrom, spfli-cityto, spfli-airpto.
If in table T02DD, the printer control characters for the print-control codes SABLD, SAOFF, and SAULN are defined as in the figure above, the system formats the output as follows:
1996/03/13 SPFLI 1
------------------------------------------------------------
AA 0017 NEW YORK JFK SAN FRANCISCO SFO
AA 0064 SAN FRANCISCO SFO NEW YORK JFK
DL 1699 NEW YORK JFK SAN FRANCISCO SFO
DL 1984 SAN FRANCISCO SFO NEW YORK JFK
LH 0400 FRANKFURT FRA NEW YORK JFK
....
The print format for the first line is set to bold, using the print-control code SABLD. The print-control code SAOFF turns off bold style, starting from the second line. Using the print-control code SAULN, the system underlines all lines starting from line 3.