Show TOC

Inserting Print Controls: PRINT-CONTROLLocate this document in the navigation structure

Procedure

You can use this command to call certain printer functions from a SAPscript text. Although you cannot enter control characters for the printer directly in your text, you can define a print control via the spool maintenance transaction SPAD that contains the printer commands you want. You can then call a print control using the PRINT-CONTROL SAPscript command.

/: PRINT-CONTROL name

Specify the name of the print control either with or without quotation marks.

The print control printed via PRINT-CONTROL should always be a print control created in the customer namespace (Zxxx) for the device type used. Use no Sxxx print controls, since their contents may be changed by SAP at any time with a release or driver modification. To modify SAP device types, refer to Note 3166.

The printer commands in the print control must never affect the current printer settings, since the SAPscript printer driver has no information on any changes triggered by a print control, which would have to be undone by commands of the driver itself. The printer driver assumes that the print control has no effect on any texts or graphics printed afterwards.

Caution

Never use PRINT-CONTROL to control print attributes covered by the SAPscript driver. To change such print attributes, use the usual method of defining form and style and the device type accordingly.

Caution
  • The contents of a print control called in this way are not available to SAPscript. SAPscript also cannot check whether the printer commands contained in the control are correct. Therefore, if you experience problems when printing a text containing these commands, you should first try to print the text without the print controls. Then, reintroduce the PRINT-CONTROL commands one by one until the command causing the problem is identified.

  • You should ensure that the printer control sequences you define leave the printer afterwards in a well-defined state. SAPscript assumes that after completing each text output certain settings (for example, font, current page) are still valid for subsequent printing. If your printer commands change these settings without resetting them again afterwards, the results may be unpredictable.

After executing a PRINT-CONTROL command, SAPscript inserts a space character at the start of the next text line. If you do not want this, you should give this text line the '=' paragraph format.