
Modifying the SWIN (SAPWIN) Device Type
The SWIN device type allows you to use any printer or fax that the Microsoft Windows Print Manager can use, regardless of whether or not a device type for the printer/fax has been defined in the SAP System. In this case, it is actually the Microsoft Windows Print Manager and Windows driver that format a document producing an output-ready data stream.
Modifying SWIN is a little bit different than working on other device types because SWIN does not deliver an output-ready data stream. Rather, it converts the R/3 internal document format into a special R/3 formatting language. The SAPlpd transfer program understands this formatting language. SAPlpd, in turn, converts the R/3 formatting commands into Windows GDI commands, which the Print Manager and the Windows device driver can use for preparing print-ready output data.
This means that rather than modifying printer commands in actions and print controls, you use R/3 formatting commands. The SWIN/SAPlpd formatting language is documented in this section.
SWIN Device Format Actions
With SAPscript formats, SWIN does not use the Printer initialization or Reset actions. Enter a comment line -- # Not used -- in these two actions in the SAPscript device formats of your copy of SWIN. This ensures that the actions will be ignored when they are called during output. SWIN list formats do use the Printer initialization and Reset actions.
In your copy of SWIN, insert commands only in the device format actions that the R/3 standard SWIN uses.
Changes Frequently Made to SWIN
In an SAPscript form definition, positioning information refers to the absolute dimensions of the paper to be used for outputting the form. At run time, however, the positioning information in SAPscript forms is added to the coordinate system of the target output device to determine where on the output page the objects in the form are actually to appear.
Since output devices use different origins for their coordinate systems, SAPscript and the spool system must offer a way to adjust form positioning to reflect the coordinate system used by an output device.
You can adapt your forms to the differing coordinate systems of output devices in the device definition, which provides the SAP spool system with information about individual printers and fax devices.
To set the fields: Choose Tools ® CCMS ® Spool ® Spool administration, change the appropriate output device, and go to the Output attributes tab page. There, you can set the horizontal positioning in Horizontal move, the vertical positioning in Vertical shift. Positive values (> 0) move the output down or to the right. Negative values in the format xxx move the output up or to the left. No decimal values are permitted. For exact positioning, use MM (millimeters) or PT (points, 10 points / inch).

If a window in a form definition is to appear 1 cm from the left edge of the paper, then on a Hewlett-Packard LaserJet printer, the window will actually be printed 1.5 cm from the left edge of the paper. The LaserJet starts its X-axis coordinate system 0.5 cm from the left edge of the paper. On a PostScript printer, on the other hand, the window will actually appear 1 cm from the left edge of the paper, because PostScript uses the physical boundaries of the paper for its coordinate system.
You can adjust the positioning of the output on the HPLJ4 (LaserJet) printer by entering -5 mm in the Horizontal move field in the second screen of the device definition of each HPLJ4 printer.
To make these adjustments, you need to change the Printer initialization action in the X_ formats in your copy of the SWIN device type.
There, you can adjust the character pitch (character spacing), leading (line spacing), and type size using the following commands:
Characteristic |
SWIN Formatting Command to Use |
Character pitch |
\ec<nn.n> where <nn.n> is the number of characters per inch.Example: \ec100 sets the pitch to 10 characters per inch. |
Leading |
\el<nn.n> where <nn.n> is the number of lines per inch.Example: \el060 sets the leading to 6 lines per inch. |
Type size |
\eS<nnn>X where <nnn> is the type size in twips (20 twips = 1 point).Example: \eS200X sets the type size to 10 points (200 twips / 20 = 10 points). |

The SWIN data stream protocol is an internal R/3 format that may change without prior notice. SAP intends to make only upwardly compatible changes to the SWIN protocol. That means that you should always be able to use the newest version of SAPlpd, even if you have not upgraded your SAP System itself.
SAP guarantees, however, only that the SWIN device type will function correctly with the development level of the SAPlpd transfer program specified for a particular R/3 Release.
For more information about the SWIN protocol, see SAPNet.
First Page of SAP Printing Guide