Adding PJL Commands to SAPscript Spool Jobs to get those print jobs captured by Celiveo 8 CVP/CSVP

Guide for SAP R/3 and SAP S/4HANA, adding advanced PJL commands for Celiveo

Key principle: PJL usually belongs in the SAP device-type and print-control layer, not directly inside the business form text. The SAPscript form should call a print control; the device type should translate it into printer-native commands.

1. Recommended architecture

For SAPscript spool jobs, the clean architecture is:

SAPscript form -> SAP print control -> SAP device type -> spool output -> printer

This keeps the business form generic and moves printer-specific PJL, PCL, PostScript, tray, stapling, punch, output-bin, secure-print, or accounting commands into the SAP printer configuration layer.
• Use SPAD to maintain device types and print controls.
• Copy standard SAP or vendor device types into a customer Z* device type before modifying them.
• Avoid modifying SAP standard device types directly.
• Use one Z* device type per printer family when commands differ by model or manufacturer.

2. The Celiveo PJL commands to add to the print job header

Celiveo Pull Printing can secure the release of unencrypted jobs sent directly to a Celie-enabled printer or to a CSVP (Celiveo Shared Virtual Printer).
You must replace the existing job header in the SAP device type with the sequences listed below.
Please note that all lines shown should be appended one after the other without any carriage returns between them. (Carriage returns were inserted in the listing below only for the purpose of improved readability.)

@PJL SET USERNAME=$(USER)\n
@PJL SET JOBNAME=$(SPOOLID)\n

\e is the ASCII 27 / 0×1B character (Escape) needed by the printer to understand this is the start of a print job command. The $(USER) must contain the user sAMAccountName or email address to be linked to a user in the Windows environment.
$(SPOOLID) can be replaced by another variable. Open SPAD → Device Types → pick a device type → Formats → Cover Page (or the “Edit Format Actions” screen), and check the variable list shown there directly, it’ll show you the full authoritative list including whatever title/name variable exists, right alongside $(SPOOLID).

The extra PJL commands shall be entered before @PJL ENTER LANGUAGE=PCL otherwise they will be printed and not considered by Celiveo.

3. Adding custom PJL with SPAD print controls

Use a custom print control when the printer requires a vendor-specific sequence, or when advanced finishing features are not covered by the standard device type.
1. Go to transaction SPAD.
2. Open Device Types.
3. Copy the existing device type to a customer Z* device type, for example ZCELIVEO.
4. Maintain Print Controls in the copied device type.
5. Create a custom print control such as ZCVO.
6. Enter the printer-native command sequence in that print control.
7. Assign the Z* device type to the SAP output device used by the spool job.

4. PJL syntax and escape prefix

A PJL job normally starts with the universal escape sequence, then PJL commands, then a language switch to PCL or PostScript. Conceptually:

<ESC>%-12345X@PJL
@PJL SET MEDIASOURCE=TRAY2
@PJL ENTER LANGUAGE=PCL

In SAP, the ESC byte is not typed as visible text. It is normally entered as a control/hex value in the print-control definition.
ESC = hex 1B

The first line therefore corresponds conceptually to:
bc. 1B 25 2D 31 32 33 34 35 58

5. Calling the print control from SAPscript

Once the print control exists in the device type, the SAPscript form can call it using PRINT-CONTROL:
bc. /: PRINT-CONTROL ZCVO

Example: Activate secure pull print before printing invoice content.
bc. /: PRINT-CONTROL ZCVO
Shipping document starts here…

6. Important limitations

• PJL works reliably only when the raw printer-native stream reaches the Windows print queue without being transformed.
• PJL may be ignored if the path uses a Windows driver conversion, EMF/XPS/PDF rendering, or another spool processor that wraps or regenerates the job.
• For SAP-generated PCL or PostScript output, prefer a raw output path that preserves the spool stream.

Recommended raw output path:

SAP spool -> SAPSprint / host spooler -> RAW 9100 or LPR -> printer

Problematic path:

SAP -> Windows printer driver -> EMF/XPS/PDF conversion -> printer
Last modified: 13 July 2026

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment