Register Login

Printing Bar codes with SAPscript

Updated May 18, 2018

How to print bar codes with SAPscript?

Which system bar codes are defined in the SAP Standard System?

As of Release 2.2A, the following are delivered with the standard system:
ARTNR, AUFNR, BARCLVS, KUNAUNR, KUNAUPS, MBBARC, MBBARC1, RSNUM, RSPOS, RUECKNR
As of Release 3.0A, the following are also delivered in the standard system:
BC_CD39, BC_EAN8, BC_EAN13, BC_I25C, BC_I25, BC_CD39C, BC_MSI, BC_MSIC, BC_MSIC1, BC_MSIC2, BC_C128B
As of Release 3.0E, the following are also delivered in the standard system:
BC_EANH, BC_PSN5, BC_PSN9
As of Release 4.6A, the following are also delivered in the standard
system:
C128A_00, C128A_01, C128B_00, C128B_01, CD39C_00, CD39C_01, CD39__00, CD39__01, BC_93
As of Release 5.0A, the following are also delivered in the standard
system:
BC_PSN11

Which of the printers in the SAP Standard System support bar codes?

As of Release 2.2A or 3.0A, the named printer bar codes are maintained for the named printers. All other printer types do not support the printing of bar codes.

IMPORTANT NOTE: If you want to print bar codes from R/3 using device type HPLJ4, HPLJ5, HPLJ5SI or HPLJ4000 on HP LaserJet 4, 5, 6 or 4000 series printers, you need what is known as a SIMM module (IC card). This SIMM module is called "JetCAPS Intelligent Barcode SIMM" and can be obtained for most HP LaserJet 4, 5, 6 and Laser Jet 4000 printers. For more detailed information refer to Note 121305. Other bar code SIMM modules for HP LaserJet printers are not supported by SAP!

IMPORTANT NOTE: If you want to print bar codes from R/3 using device types  HPLJ4, HPLJ5, HPLJ5SI or HPLJ4000 on Lexmark Optra S 1255, 1855, 2455, 1625, Se3455 series printers, you need what is known as a SIMM module (IC card). This SIMM module is called "Lexmark Optra Bar code SIMM" and can be obtained from Lexmark or from Lexmark authorized distributors and dealers.
Refer to Note 119471 for more specific information.
Other bar code SIMM modules for Lexmark printers are not supported by SAP!

Bar code: Printer types:              Technical bar code type:
As of Release 2.2A:
ARTNR     KYOF1000,KYOF1200,KYOFS150   code 128
          HPLJ4                        code 128 autoswitch
AUFNR    KYOF1000,KYOF1200,KYOFS150    see ARTNR
          HPLJ4
BARCLVS  KYOF1000,KYOF1200,KYOFS150   code 39 no check digit
          HPLJ4                        code 39 no chk
KUNAUNR  KYOF1000,KYOF1200,KYOFS150    see ARTNR
          HPLJ4
KUNAUPS  KYOF1000,KYOF1200,KYOFS150    see ARTNR
          HPLJ4
MBBARC    KYOF1000,KYOF1200,KYOFS150    see ARTNR
          HPLJ4
MBBARC1  KYOF1000,KYOF1200,KYOFS150   EAN-8
          HPLJ4                        EAN-8
RSNUM    KYOF1000,KYOF1200,KYOFS150    see ARTNR
          HPLJ4
RSPOS    KYOF1000,KYOF1200,KYOFS150    see ARTNR
          HPLJ4
RUECKNR  KYOF1000,KYOF1200,KYOFS150    see ARTNR
          HPLJ4

As of Release 3.0A:

BC_CD39   KYOF1000,KYOF1200,KYOFS150   code 39 with no check digit
          HPLJ4                        height 13 mm, no text
BC_EAN8   KYOF1000,KYOF1200,KYOFS150   EAN 8
          HPLJ4                        height 13 mm, no text
BC_EAN13  KYOF1000,KYOF1200,KYOFS150   EAN 13
          HPLJ4                        height 13 mm, no text
BC_I25C   KYOF1000,KYOF1200,KYOFS150   interleaved 2of5 with checksum
          HPLJ4                        height 13 mm, no text
BC_I25    KYOF1000,KYOF1200,KYOFS150   interleaved 2of5 with no
          HPLJ4                        checksum
                                      height 13 mm, no text
BC_CD39C  KYOF1000,KYOF1200,KYOFS150   code 39 with check digit
          HPLJ4                        height 13 mm, no text
BC_MSI    KYOF1000,KYOF1200,KYOFS150   MSI with no check digit
          HPLJ4                        height 13 mm, no text
BC_MSIC   KYOF1000,KYOF1200,KYOFS150   MSI with single mod-10 check
          HPLJ4                        digit
                                      height 13 mm, no text
BC_MSIC1  KYOF1000,KYOF1200,KYOFS150   MSI mod-10 with mod-10 check
          HPLJ4                        digit
                                      height 13 mm, no text
BC_MSIC2  KYOF1000,KYOF1200,KYOFS150   MSI mod-11 with mod-10 check
          HPLJ4                        digit
                                      height 13 mm, no text
BC_C128B  KYOF1000,KYOF1200,KYOFS150   code 128 B
          HPLJ4                        height 13 mm, no text
As of Release 3.0E:
BC_EANH   KYOF1000,KYOF1200,KYOFS150   code 128
          HPLJ4                        EAN 128
                                      height 13 mm, no text
BC_PSN5   KYOF1000,KYOF1200,KYOFS150   USPS Postnet
          HPLJ4                        ZIP+4 POSTNET 5
                                      height 3 mm, no text
BC_PSN9   KYOF1000,KYOF1200,KYOFS150   USPS Postnet
          HPLJ4                        ZIP+4 POSTNET 9
                                      height 3 mm, no text

As of Release 4.6A:

C128A_00  KYOFS150,KYOFS170            code 128, character set
          HPLJ4,HPLJ5,HJPLJ5SI,HPLJ4000    rotation=000
                                      height 5 mm, no text
C128A_01  KYOFS150,KYOFS170            code 128, character set A
          HPLJ4,HPLJ5,HJPLJ5SI,HPLJ4000    rotation=090
                                      height 5 mm, no text
C128B_00  KYOFS150,KYOFS170            code 128, character set B
          HPLJ4,HPLJ5,HJPLJ5SI,HPLJ4000    rotation=000
                                      height 5 mm, no text
C128B_01  KYOFS150,KYOFS170            code 128, character set B
          HPLJ4,HPLJ5,HJPLJ5SI,HPLJ4000    rotation=090
                                      height 5 mm, no text
CD39C_00  KYOFS150,KYOFS170            code 39 with check digit
          HPLJ4,HPLJ5,HJPLJ5SI,HPLJ4000    rotation=000
                                      height 5 mm, no text
CD39C_01  KYOFS150,KYOFS170            code 39 with check digit
          HPLJ4,HPLJ5,HJPLJ5SI,HPLJ4000    rotation=090
                                      height 5 mm, no text
CD39__00  KYOFS150,KYOFS170            code 39 w/o check digit
          HPLJ4,HPLJ5,HJPLJ5SI,HPLJ4000    rotation=000
                                      height 5 mm, no text
CD39__01  KYOFS150,KYOFS170            code 39 w/o check digit
          HPLJ4,HPLJ5,HJPLJ5SI,HPLJ4000    rotation=090
                                      height 5 mm, no text
BC_93     KYOFF150, KYOFS170          code 93
          HPLJ4 ,HPLJ5,HPLJ5SI,HPLJ4000 height 13 mm, no text

Rotation of bar codes:

As of Release 4.5A the rotation of bar codes is supported via PCL-5 and the PRESCRIBE printer driver. There, a system bar code with 000, 090, 180, 270 degrees can be defined. When printer driver HPL2 (with BarSimm installed) or PRES is used, the output of the bar code is then rotated anti-clockwise by the amount specified.In SAPscript, the bar codes are basically dealt with as text data (for example, the character string 0123456789), before which the printer must receive a certain control sequence for switching on the bar code printing and AFTER which the printer must receive another control sequence for switching off the bar code printing.

In SAPscript forms, the bar codes are addressed as an attribute of the so-called character formats (sometimes also called character strings). A character format initializes a bar code for the text data marked this way by entering a so-called system bar code in the form for this character format (an identifier with a maximum of eight characters, for example, ARTNR). In the SAPscript editor, character strings are marked as follows: 12345678 --BC in this case is the name of the character  

Definition and processing of barcodes in SAPscript:

string. In the SAPscript font maintenance Transaction SE73, you can look at and maintain the list of system bar codes. Customer-specific system bar codes must begin with Z...

The printer-specific conversion to print controls is carried out via another table in SE73, the printer bar codes. There you can allocate an initiating print control, what is known as the bar code prefix and a closing print control, the bar code suffix, to every system bar code (for example ARTNR) for every desired printer type (for example, KYOF1200). The naming conventions for the prefix is SBPxx and SBSxx for the suffix.

These are what are known as print controls and are entered only BY NAME in Transaction SE73 (for example SBP01, SBS01). The actual control commands for the print controls are maintained in the SPOOL management Transaction SPAD.
NOTE: If you want to change the print controls or printer bar codes for an SAP standard device type, NEVER modify the original (for example, KYOF1200). Instead, create a copy of the device type beginning with Z... and modify and use this copy (see Note 3166).

When maintaining the print controls for bar codes (the initiating print controls should be named starting with SBPxx, the closing print controls starting with SBSxx), you have to take the following special features of the SAPscript printer driver into consideration:

1. PRESCRIBE printers:

The driver PRES for KYOCERA laser printers with the programming language PRESCRIBE automatically sets single quotes (') around the bar code data when printing a bar code. Thus, they may NOT be entered again in the print controls. Below, you see an example of what the print controls could look like for printing a bar code with SAPscript for the printer type KYOF1200:
SBP01 (bar code prefix): BARC 15,N,
SPS01 (bar code suffix): ;
After SBP01, the PRES driver automatically sets the quote around the characters to be printed (for example, 0123456789) which is demanded by the PRESCRIBE programming language for the BARC command. As a result, the following command is sent to the printer:
BARC 15,N,'0123456789';

2. POSTSCRIPT printers:

The driver POST for POSTSCRIPT printers (printer types POSTSCPT and POST2) automatically sets parentheses (,) around the bar code data when printing a bar code. Thus, they may NOT be entered again in the print controls. This way, the data is marked as POSTSCRIPT string constant.
Essentially special bar code fonts or bar code software is required for printing bar codes with PostScript which must exist on the PostScript printer since the SAP PostScript printer driver currently has no bar code generator. This software must be purchased from other suppliers and installed on the printer. The device types POSTSCPT and POST2 in the SAP standard system does not support bar code printing.
The program "Tattoo PS" by the company Integrated Software Design, Inc. was tested at SAP. It makes a relatively comfortable definition and output of bar codes on PostScript printers possible. You can find further information on Tattoo PS in Note 108990.

3. All other printers:

Drivers STND, STN2, HPL2 and SWIN send the bar code data "as-is" to the printer. Thus, all additional specifications required for the bar code printing have to be maintained in the two print controls.

How can the bar code printing be tested in SAPscript?

The SAPscript standard text SAPSCRIPT-BARCODETEST with ID ST, languages D,E prints the standard bar codes (Transaction SO10). Usually, the test is only available in client 000.

 


×