Procedure documentationEditing Format Actions

 

Caution Caution

For device types that use one of the drivers HPL2, POST, PRES, or SWIN for formatting lists, formatting does not take place in the actions but is executed by the drivers. You can edit the attributes of the formats so that you no longer have to enter control sequences in the individual actions. For information on this, see Editing Device Type Formats.

End of the caution.

Procedure

The following is a description of how you edit the actions of formats that do not use any of the list printer drivers:

  • Device Type Formats: You can use the X_65_80 (list output) and DINA4 (SAPscript) device type formats as templates for your own device type formats. If you are adding a new format to an existing device type, then these device type formats can help you to identify the actions and commands that the new device type format should contain.

  • Which actions are required? Only the actions listed below are used by the SAP system. You can leave all other actions empty. They are reserved for future use.

Device Type Format Actions Used by SAP

Action

Usage and Notes

Title Page

Inserted as the first element in the output data stream, before the printer initialization action.

Use: Prints an identification sheet at the start of an output request.

Note Note

  • The Title page action is sent only if activated by default (per printer in the Output device definition) or by the user in the print selection screen.

  • By default, the Title page action of the X_PAPER format is used. Standard SAP device types define only the X_PAPER title page. You can override the default for particular formats by defining a Title page action for the format.

End of the note.

For more information, see Maintaining Title Pages for Output Requests.

Printer Initialization

Sent at the start of an output request after the title page action (if any) has been sent to the printer.

Use: Configures the printer as required by the format of an output request.

Note Note

  • For list formats, copy the required printer commands from the device type format X_65_80 of a similar device type. Printer initializations often specify the character set, page length, line feed, character spacing, and font. Printer initializations vary greatly, however, depending on device type.

  • For SAPscript formats, copy the required printer commands from the DINA4 device type format of a similar device type. Printer initializations often specify the printer emulation and the character set. You do not need to specify font, pitch, line feeds, or paper type. The SAPscript printer drivers make these specifications themselves via print controls. Printer initializations vary greatly, however, depending on device type and OTF driver.

End of the note.

Reset after exit

Sent at the end of a print request.

Use: Reset a printer to a particular state, such as a particular emulation.

Note Note

  • Leave the action undefined or enter a comment if you do not want to reset the printer.

  • Ensure that the escape sequences you enter do not cause a line feed or otherwise change the print position.

  • Set to comment # (no operation) for SWIN and related device types.

End of the note.

End of a page

Sent at the end of every page of an output request.

Use: Used in printing lists to generate a form feed (new page).

See the table below for a summary of the requirements for the end-of-page and end-of-line actions.

End of line

Sent at the end of each line in an output request.

Use: Used for list output and for most SAPscript output to generate a new line (carriage return and line feed).

See the table below for a summary of the requirements for the end-of-page and end-of-line actions.

Start a new page

Sent at the start of every page of an output request.

Only defined in POSTSCPT list formats. Not defined in standard SAP device formats; has therefore no effect on output. Inserted in the output stream by default so that you can use it if needed.

Start of line

Sent at the start of every text line of an output request.

Only defined in POSTSCPT list formats. Not defined in standard SAP device formats; has therefore no effect on output. Inserted in the output stream by default so that you can use it if needed.

  • End of Page, End of Line Actions: Required Definitions

    Format Type

    End of Line Definition

    End of Page Definition

    X_* formats for list output

    \r\n

    \r\f

    SAPscript STN2 driver

    # (comment, null operation)

    # (comment, null operation)

    SAPscript HPL2 driver

    \r\n

    # (comment, null operation)

    SAPscript PRES driver

    \r\n

    # (comment, null operation)

    SAPscript POST driver

    \n

    # (comment, null operation)

    SWIN driver for Microsoft Windows printing

    \n

    \f

  • Specifications for Line Spacing and Page Length for Line Printers: SAP standard Printer initialization actions for line printers (printers that use the SAPscript STN2 OTF driver) specify line spacing (lines per inch) and page length (lines per page).

    These specifications do not select a particular paper size at the printer. Rather, they tell the printer where to insert a page break in the output.

    The following table shows the line spacing and page lengths for the standard SAP formats.

  • Line Printer Specifications

    Formatting

    Required values in the Printer initialization actions.

    DINA3

    Line spacing: 6 lines per inch (LPI)

    Page length: 140 lines

    Note: Not pre-defined for most device types.

    DINA4

    Line spacing: 6 LPI

    Page Length: 70 lines

    DINA5

    Line spacing: 6 LPI

    Page Length: 50 lines

    EXECUTIV

    Line spacing: 6 LPI

    Page Length: 72 lines

    LETTER

    Line spacing: 6 LPI

    Page Length: 66 lines

    LEGAL

    Line spacing: 6 LPI

    Page Length: 72 lines

    INCH4

    Line spacing: 6 LPI

    Page Length: 25 lines

    INCH4C

    Line spacing: 6 LPI

    Page Length: 24 lines

    INCH6

    Line spacing: 6 LPI

    Page Length: 36 lines

    INCH7

    Line spacing: 6 LPI

    Page Length: 42 lines

    INCH8

    Line spacing: 6 LPI

    Page Length: 48 lines

    INCH11

    Line spacing: 6 LPI

    Page Length: 66 lines

    INCH12

    Line spacing: 6 LPI

    Page Length: 72 lines

    LINE_21

    Line spacing: 6 LPI

    Page Length: 21 lines

    LINE_22

    Line spacing: 6 LPI

    Page Length: 22 lines

    If you are defining device type formats for a page printer (SAPscript drivers POST, PRES, and HPL2), then refer to the corresponding device type format in a similar device type for the line spacing and page length specifications required.

  • Action Printer Initialization Action: Ensure that the escape sequences that you define match the page dimensions and orientation specified in the format and page format associated with a device type format.

    Also, ensure that any character set specified in escape sequences matches the character set specified in the device-type definition. The character set must also be compatible with any implicit character set changes made at the printer by SAPscript font changes. The spool system cannot test to ensure that these specifications match. To test printing, see Testing Output Devices.

  • The action editor and special characters for printer initializations and print controls: The system uses the SAP programming editor for maintaining device escape sequences. In the editor, you can use the special characters shown in the table below to simplify entering escape sequences. The table below lists these special characters.

    You can define cover sheets with various variable, such as $(BENUTZER) (user) and $(SPOOLID) (Spool number), (see Maintaining Cover Sheets for Output Requests).

    Characters

    Meaning

    \e

    ESC (Escape). It has the hexadecimal value 1B and the decimal value 27.

    \0x

    Marks the following two characters as a hexadecimal number (one byte). Example: 0xF0

    #

    Marks an entire line as a comment at the beginning of the line. The line is not sent to the output device.

    \n

    Line feed (hexadecimal 0A)

    \r

    Carriage return (hexadecimal 0D)

    \f

    Form feed (hexadecimal 0C)

    \s

    Space character (when required at the end of a line) (Hexadecimal 20)

    Note Note

    Line breaks: Note that the line ends in the editor are not sent to the output device. To start a new line in the printer output stream, you must enter \n or \r\n in the device escape sequence.

    End of the note.
  • Standard actions: If a format does not contain a definition for the title page (in the device type format), then the X_PAPER title page is printed as a default.

    The spool system uses default actions if two other actions -- end of page or end of line -- are undefined. The default actions may result in printing of empty lines or pages in SAPscript print requests that use the STND or STN2 drivers.

    To prevent the spool system from using defaults for undefined actions, define each of these actions with at least one comment line in each device type format that you define. SAP has defined these actions in all standard SAPscript formats.

SAP Printing Guide Start Page