Which Barcode Product Is Best Suited for My Environment?

TEC-IT offers three different solutions for bar code generation in SAP. Each solution has its special advantages and characteristics.

TBarCode/SAPwin

This Barcode DLL is recommended for Microsoft® Windows environments in which you can print centrally via a print server with SAPSprint (spooling software of SAP) or on the SAPGUI client (front-end printing). Any printer using Windows drivers can be connected. The Barcode DLL is also the solution of your choice in case of Unicode printing with SWINCF or other CF device types.

TBarCode/Direct

If your company mainly uses PostScript® compatible printers, then TBarCode/Direct is the best solution. No middleware, central installation, all printers (with PostScript).

TBarCode/X

TBarCode/X is an all-round barcode software solution for UNIX®, Linux® and Mac OS X® environments. TBarCode/X can be installed into the spool system of a print server (or on the SAP server itself). Suitable for PCL and PostScript® printers. Existing device types for PCL printers can be reused, no change to Windows drivers required.

What Are the Basic Installation and Configuration Steps?

You must use at least one of the Spool Transfer Programs SAPSprint or SAPlpd - or the SAPGUI (Windows) Client.

Using SAPSprint

  • Install TBarCode/SAPwin in the SAPSprint installation folder.
SAPSprint is a Spool Transfer Software from SAP (see OSS Note # 894444) designed to be used on a print server (Windows platform).

Using SAPGUI

  • Using Windows Client (front-end printing), install TBarCode/SAPwin into the SAPGUI directory (method G). Use the x64 version for SAPgui 5.0+ (64-bit)

Configuring SAP

  • Copy the device type SWIN to ZSWIN.
  • In SPAD, add a new printer or modify an existing printer (e.g. your local printer), use ZSWIN as device type. The host spool method can be G (GUI), F (front-end/SAPlpd) or S (Server/SAPSprint).
  • Print the test document SAPSCRIPT-BARCODETEST available on client 00. You should see barcodes on the print-out by then.

More Information:

For detailed TBarCode/SAPwin installation instructions read the TBarCode/SAPwin Manual.

Insert a Data Matrix Barcode into Your SAP System

Here are the steps to insert a Data Matrix bar code into your SAP system.

Precautions

  • Make sure you have a copy of a SAPWIN based device type (e.g. copy device type SWIN to ZSWIN – see our manual 6 Create a Device Type Copy).
  • Assign this device type to a printer – see manual 7 Assign the Device Type to a Printer.
  • You can test your TBarCode/SAPwin installation by printing the SAPSCRIPT- BARCODETEST (client 00) - see our manual 9 Test Barcode Printing. If this SAPscript document does not exist you can request it from our support.

Add Data Matrix System Bar Code

  • Use Transaction SE73 – System Bar Codes (see manual 12.2.1 New System Barcode). Add a new system barcode (namespace Z... e.g. name = ZDATMAT) as conventional system barcode ("old" bar code technology).

Define Data Matrix Printer Barcode

  • Enter Transaction SE73 – Printer barcodes. Follow the steps in the manual section "8 Define Printer Barcodes".
  • Select ZDATMAT and add a new prefix for it (e.g. SBP90), as for the suffix you can use the existing suffix SBS01.
  • Edit the prefix (SBP90) and enter the control sequence: bC=DMX,M=508,D=

    Make sure that the prefix Variant is set to 5, you can change that in transaction SPAD. The Printcontrol must be marked Extended (see manual 23.4.4 Wrong Variant of Print-Control Prefix.)

Add Data Matrix Character Format (Style)

There are multiple ways to insert a barcode into your form (see manual 11 Using Barcodes in SAP). If you decided to use a bar code character format (preferred way), you have to add ZDATMAT as new available character format to your style.

  • Edit the style you have assigned to your form and add ZDATMAT as new barcode character format.
  • Use transaction SE72 for editing SAPscript styles.
  • Use transaction SmartStyles for editing Smart Form styles (see manual 11.2.2)

More Printcontrols

DP Premium Address 22x22 Data Matrix:
  • Data provided in ASCII format (with escape sequences)
    bC=DMX,M=423,DMB=1,DMS=7,E=1,D=
  • Data provided in Hex format
    bC=DMX,M=423,DMB=1,DMS=7,DH=
GS1 DataMatrix:
  • Print control prefix
    bC=DMX,M=508,DMF=1,E=1,D=
  • Sample data: 0112345678901231101234567890\F11120727
    \F encodes the FNC1 field terminator for variable length AI fields.

Insert a QR Code® into Your SAP System

Here are the steps to insert a QR Code® 2D bar code into your SAP system.

Precautions

  • Make sure you have a copy of a SAPWIN based device type (e.g. copy device type SWIN to ZSWIN – see our manual 6 Create a Device Type Copy).
  • Assign this device type to a printer – see manual 7 Assign the Device Type to a Printer.
  • You can test your TBarCode/SAPwin installation by printing the SAPSCRIPT- BARCODETEST (client 00) - see our manual 9 Test Barcode Printing. If this SAPscript document does not exist you can request it from our support.

Add QR Code System Bar Code

  • Use Transaction SE73 – System Bar codes (see manual 12.2.1 New System Barcode). Add a new system bar code (name space Z... e.g. name = ZQRCODE) as conventional system bar code ("old" bar code technology).

Define QR Code Printer Barcode

  • Enter Transaction SE73 – Printer bar codes. Follow the steps in the manual section "8 Define Printer Barcodes".
  • Select ZQRCODE and add a new prefix for it (e.g. SBP91), as for the suffix you can use the existing suffix SBS01.
  • Edit the prefix (SBP91) and enter the control sequence: bC=QR2,M=508,D=

    Make sure that the prefix Variant is set to 5, you can change that in transaction SPAD. The Printcontrol must be marked Extended (see manual 23.4.4 Wrong Variant of Print-Control Prefix).

Add QR Code Character Format (Style)

There are multiple ways to insert a barcode into your form (see manual 11 Using Barcodes in SAP). If you decided to use a bar code character format (preferred way), you have to add ZQRCODE as new available character format to your style.

  • Edit the style you have assigned to your form and add ZQRCODE as new barcode character format.
  • Use transaction SE72 for editing SAPscript styles.
  • Use transaction SmartStyles for editing Smart Form styles (see manual 11.2.2)

More Printcontrols

  • QR-Code with UTF-8 encoding (e.g. for Chinese characters):
    bC=QRC,M=1016,CP=6,D=
    Note: Needs TBarCode/SAPwin 10.1 in combination with SAPSprint 730 Patch 16 and/or SAPGUI 730 Patch 10 or newer. A device type with Unicode support (SWINCF or SWINCFC) must be used.

Data Limit with 2D Barcodes

Depending on SAP version and whether you use SAPscript or Smart Forms you have a limit between 70 and 255 characters for the bar codes.

    Technical background: In SAP the lines are processed in two steps: In the first step, the paragraph is treated like normal text, i.e. line breaks are added as needed (depending on the available space and font size). In the second step, the line marked as barcode is passed to the barcode generator and the barcode image is added. But only the first line (before the text break) is converted to a barcode - the others remain unconverted. So the goal is to avoid unnecessary text breaks and to fit the barcode data into a line of text.

Below we describe the possible workarounds to overcome this limit:

Font Size

Use a very small font size (e.g. 6 pt) for the line, where you draw the bar code. This increases the number of characters for the actual line.

Smart Forms

Take a look at OSS notes 497380. Please try activating the barcode via print control and use several fields (each 255).

SAPscript

Use the Print control command as shown below. The name of the print controls can be seen in the device type (SE73 printer barcodes). Split up the data into several fields (each 68).

/: PRINT-CONTROL SBP90.
=  &V_BC1&
=  &V_BC2&
/: PRINT-CONTROL SBS01.

According to SAP note 197177 it may be necessary to surround the print control command by a small font tag:

*  <fs><32>
/: PRINT-CONTROL SBP90.
=  &V_BC1&
=  &V_BC2&
/: PRINT-CONTROL SBS01.
*  </>

Alternatively you can use the RAWTEXT command as shown in SAP note 497491:

/: PRINT-CONTROL SBP90.
/: RAWTEXT &V_BC1&
/: RAWTEXT &V_BC2&
/: PRINT-CONTROL SBS01.

Barcode DLL Variables

The Barcode DLL supports "variables", which are concatenated together before creating the bar code. You also have to split up the data into multiple "data chunks" with that method. Advantage: You can use the common character formats for creating the bar code and can omit the (device type specific) print control command.

See 2D Barcode Data Splitting

How Can I Export a Device Type?

  • Enter transaction SPAD
  • Main Menu: Utilities --> For Device Types --> Export
  • Object Selection = Device Type
  • Enter the name of the device type into the input field [Object Name]
  • Click Execute or press F8
  • In the following dialog enter (or confirm) the path where the export file should be saved

How Can I Print Chinese Characters?

Please look at SAP OSS Note # 83502.

If your SAP system is a Unicode system, there should be a device type SWINCFC for printing Chinese characters. For Non-Unicode systems you can use CNSAPWIN.

  • Make a copy of it and adjust the Printer Barcodes (transaction SE73) as shown in our manual.
  • Then assign this device type to your printer (transaction SPAD).
For TBarCode/SAPwin you need a device type based on the SAPwin device driver!

Unwanted Characters Printed Beside the Barcode

Wrong defined print control suffix SBS01

  • Please read FAQ section 23.11 of the user manual to learn how to solve this problem.
  • Please check out SAP Note 1079665 - Missing formats and bar codes in SAPWIN device types
  • On Unicode systems, in the device types SWINCF and SWINCFC, the suffix should be Variant 1 and Hex sequence 1B00.

Chinese characters printed beside the last bar code

A buffer problem resulting in the output of Chinese characters after the last bar code has been fixed in SAPSprint 740 Patch 5. You have to update at least to this patch level or a newer one to get rid of this problem. The issue is specific to Unicode printing and may occur with TBarCode/SAPwin 10.1 or later.

Changed Barcode Properties After Support-Package SAPKB70026

Problem: After installation of SAPKB70026 bar codes may be printed with different size or with different bar code properties.

Reason: The support package may switch from conventional bar code technology (Barcode DLL) to new bar code technology from SAP.

The new bar code technology from SAP creates an image, which will be insert into the print data stream on server side. The Barcode DLL remains unused, settings from printer bar codes (SE73) are ignored.

We recommend to contact SAP support. We don't know any method to switch a system bar code from new bar code technology back to conventional bar code technology in order to restore the original behavior.

No Barcodes on the Printout

Possible reasons:

  • Wrong host spool access method,
  • Wrong device type,
  • Wrong print controls in the device type
  • Barcode DLL installed for SAPlpd but front end printing uses control technology (see following FAQ).

Please read FAQ section 23.2 of the user manual. Make sure you have the actual version of TBarCode/SAPwin installed.

Please check out SAP Note 1079665 - Missing formats and bar codes in SAPWIN device types.

No Barcodes After Upgrade of SAP System

Problem: You are using front end printing with host spool method F and SAPlpd. After the upgrade of your SAP system the SAPlpd window no longer comes up and no bar codes are created.

  • Upgrade to SAP ERP 6.0 Enhancement Package (EHP) 7 and/or Support Pack Stack (SPS) 18 - or later

Reason: After the upgrade SAP uses the same mechanism for front-end printing as with host spool method G. The document is sent to SAPgui for processing and the Barcode DLL from the SAPlpd folder is not loaded. See also SAP note 2028598 for details.

Solution: Install the Barcode DLL for printing with SAPgui / host spool method G as described in the user manual of the product.

  • Uninstall TBarCode/SAPlpd or TBarCode/SAPwin (via Control Panel)
  • Download TBarCode/SAPwin latest version (32 Bit).
  • After running the setup, change the path of the component "Barcode DLL for SAPSprint, SAPgui..." to the path of SAPgui - usually C:\Program Files (x86)\SAP\FrontEnd\SAPgui\ .
  • Make sure you have a license for the latest product version of TBarCode/SAPwin. In case of questions please contact our sales@tec-it.com or support@tec-it.com.
The Barcode DLL for SAPlpd is not compatible with front end printing / host spool access method G. Users of TBarCode/SAPlpd Version 5 need to update their product and license key.

Wrong Barcode Size After Update to Version 10

Problem: Rotated bar codes changes their size after updating from a previous version to version 10 of the Barcode DLL.

Reason: In version 10 the parameters for width and height are relative to the bar code, in previous versions they were relative to the page.

Solution: For rotated bar codes the width and height needs to be exchanged (in the print control).

  • Identify the device type, which is assigned to your printer (e.g. ZSWIN) - use SPAD.
  • Identify the bar code, which is used on the form (e.g. ZBC...). The print control prefix contains R=90 or R=270.
  • Edit the print control prefix for the bar code in the device type - use SE73 or SPAD.
  • Exchange width and height (B=ValueOfH,H=ValueOfB) in the control character sequence for the bar code.

Wrong Barcode Position After Update to Version 10

Problem: The bar code position changed after updating from a previous version to version 10 of the Barcode DLL.

Reason: In version 10 the bar code is drawn from actual cursor position upwards (bar code origin is bottom left) - this corresponds to BarSIMM/DIMM modules. In previous versions the bar code was drawn from cursor position downwards (bar code origin was top left).

Solution: In order to restore the behavior of the previous versions you can set Direction=-1 in the barcode.ini file.

After Licensing the Barcodes Are Still in Demo Mode

Deployment

First install the Barcode DLL on the client (SAPgui) or on the server (SAPSprint) – depending on the way you print. More information about installation steps can be found in the user manual (please check it out).

After completing the setup, the barcode.ini file, which contains the license data must be copied into this location (the path is version dependent!):

C:\ProgramData\TEC-IT\TBarCode SAPwin\10
The ProgramData folder may be hidden in file explorer – but you can paste the path to the address bar and then you are there.
  • You have to overwrite the default barcode.ini, which comes with the setup.
  • For front-end printing using SAPgui: After you have exchanged the barcode.ini file, the SAPgui and all SAP programs must be completely terminated and restarted to import the changed license.
  • For printing through SAPlpd: You have to restart SAPlpd to read in the new license.

Troubleshooting:

  • The license key must match your main version (e.g. a key for version 9 can be used only with version 9 but not with version 10).
  • Don’t copy the barcode.ini to the Windows directory or into the SAPSprint or SAPgui directory. Multiple barcode.ini files on the hard drive can lead to confusion and a mix of correct and incorrect license keys. Make sure that there is only one barcode.ini on the system and it is in the path we have shown above (path is version dependent). You can do a global file search to see if you have more barcode.ini files on the system.
  • After each change of the barcode.ini file you need to restart SAPgui and SAPlpd (if you use them).

Wrong Printing Order, Intermittent Licensing

The following issues may be caused by parallel job processing (multi-threading) in SAPSprint.

Wrong Printing Order

Fix: Turn off print job based multi-threading with the following command line:

sapsprint -oi ProcessingMode 1

* This parameter is supported in SAPSprint 1015.

For problems with printing sequence caused by multi-threading read SAP Note 1054561.

No Bar Codes after Heavy Traffic

Some users are printing at the same time large print jobs via SAPSprint. After the end of a such a print job containing bar codes, the bar codes on subsequent print jobs are missing.

  • This may be caused by multi-threading. See previous solution Wrong Printing Order

Some Bar Codes Are Licensed, some Bar Codes Have Demo Text

  • Use the latest version of TBarCode/SAPwin
  • Check if you have multiple versions of the barcode.dll and/or barcode.ini file in your system. You should use only one version. Make sure that the license key is the same in all barcode.ini files.
  • This may be caused by multi-threading. See previous solution Wrong Printing Order.

SAPSprint Print Job Terminates with CreateDCW

OSS Note 1069483 -"Error: CreateDCW failed: The operation completed successfully".

This error is caused by a third party print monitor (coming with Windows printer driver installation).

The following options in SAPSprint Version 1018 and later can deal with the CreateDCW error:

  • The service restarts automatically once the CreateDCW problem occurs. You can prevent auto-restart by setting the parameter values to 1.
            Key: IgnoreDCError
            Default: 0
            Other values: 1
    
  • The SAPSprint service restarts automatically after a specified number of print jobs. This mainly reduces the occurrence of the CreateDCW problem described in Note 1069483. If the value is set to 0 (default), this service will not restart.

            Key: RestartAfterJobs
            Default: 0
            Other values: any number
    

Try to update or downgrade the printer driver / printer port software. Not always newer versions give better results - sometimes elder drivers are more stable. A printer with PCL emulation can usually use a standard HP Laserjet 4 PCL-5 driver as well. It is also possible to use a standard Adobe driver for PostScript emulation. Often the so called "universal drivers" create more problems as the printer specific driver.

Distorted Barcode Image

This behavior is most often caused by the Windows printer driver.

  • Get the latest version of TBarCode/SAPwin.
  • Change the drawing method in the barcode.ini file:
     [DRAW_MODE]
     UseGDIRect=1
    
    If the bars are too wide, set UseGDIRect=0. When using SAPlpd, WWI or SAPgui, make a restart.

You can also try the following:

  • Print bar-codes without human readable text: Set A=0 in the print control prefix of your printer barcode (edit it with TA SE73).
  • Change the printing direction: set Direction=1 in the barcode.ini file.
  • Such problems may also be caused by multi-threading. See previous solution.

SAPlpd Crashes with High Amount of Barcode Data

Using 2D bar codes with a huge amount of data (e.g. via SAPscript's rawtext command), once you reach the limit of about 250 - 300 characters, SAPlpd suddenly crashes. This seems to be caused by a buffer limit in SAPlpd and is not a problem of TBarCode/SAPwin.

First of all verify if you can change from SAPlpd to newer SAPSprint or SAPFprint: From SAPlpd to SAPSprint and SAPFprint

A workaround for SAPlpd would be the data splitting feature of TBarCode/SAPwin. It separates the data portions into two or more blocks (infos on request). You can stay below the crash limit this way.

How Can I Fine Tune the Barcode Position?

Position may be:

  • relative (no X/Y parameters specified in Printcontrol) or
  • absolute (X/Y parameters specified in Printcontrol)

Additionally you can change the printing direction to print the barcode from base line upwards - see parameter Direction in the barcode.ini file:

Direction=1

If you print the barcode always to the same position you can specify X and/or Y parameters in the Printcontrol.

  • Set the target coordinates with the parameters X=[mm],Y=[mm] in the Printcontrol prefix:
    bC=39,X=100,Y=50,B=50,H=20,D=
    The print control prefix can be modified in transaction SE73 (printer bar codes). Click the prefix, and then the button Maintain PrintControl. After that, a window will be displayed allowing you to change the character sequence.

If the barcode is printed on a relative position (inline) you can use the Shift parameter in the Barcode.ini file to fine-tune the bar codes Y position. The shift parameter was introduced to overwhelm printer driver problems or to make relative positioning compatible with other solutions (e.g. hardware barcode printer extensions).

  • In the Barcode.ini you have to set the Direction parameter to 1, after that you can adjust the vertical bar code position via the Shift parameter, wherein a negative value is also allowed.
    [SETTINGS]
    Direction=1
    Shift=1
    

How Can I Change the Size / Orientation of the Barcode?

You can change the bar code size and orientation in the Printer Barcode Printcontrol Prefix. The following parameters are available:

  • B= ... controls the width of the symbol in mms
  • H= ... controls the height of the symbol in mms
  • M= ... controls the module width of the symbol (in 1/1000 mms)
  • R= ... adjust the orientation of the barcode in degree (optional)
* If parameter M is used, omit the B parameter!

Examples

  • Width: 70 mm, Height: 30 mm, Rotation=90°
            bC=E128,B=70,H=30,A=1,R=90,D=
  • Module Width: 0.254 mm, Height: 30 mm
            bC=E128,M=254,H=30,A=1,D=

You can edit the Printcontrol Prefix in transaction SE73 (printer bar codes).

  • Select your device type e.g. ZSWIN. In the edit dialog, click the prefix and then the button Maintain Printcontrol. Change the Printcontrol parameters in the Control Char Sequence input field.

How Can I Change the Font of the Human Readable Text?

By default the Barcode DLL uses the font settings from SAPSprint or SAPGUI (in most cases equivalent to the font used in previous text output before the bar code). If you want to specify the font of the human readable text to be different you have the following possibilities.

Print Control

The font for a specific bar code type (printer bar code) can be adjusted individually via Print Control parameters.

  • FN=Font Name
  • FS=Font Size [pt]
  • FW=Font weight [N.. normal | B .. Bold]

Example (adjust 10 pt Arial):

bC=39,M=254,H=16,FN=Arial,FS=10,D=

The print control prefix can be modified in transaction SE73 (printer bar codes). Click the prefix, and then the button Maintain PrintControl. After that, a window will be displayed allowing you to change the character sequence.

Barcode.ini

  • In the Barcode.ini file you can adjust the bar code font for all bar code types (as a global setting) with the following parameters:
    [SETTINGS]
    DefFontName=Courier New
    DefFontSize=8
    DefFontWeight=bold
    
    Remove the “;” in front of the parameters to activate them.
  • If you need a different font for your EAN and UPC bar codes, you can use the separate EAN_UPC parameter group in Barcode.ini:
    [EAN_UPC]
    FontName=Courier New
    FontSize=10
    FontWeight=bold
    

Barcode Log File Coordinates

The following sample describes the barcode position parameters you can see in the barcode.log file:

  • Printcontrol parameters are shown first, e.g:
    C=128B,B=43,H=7,X=0,A=0,D=
    
    The X position in our example is zero. The Y position is not specified, so it will be taken from actual cursor position by default.
  • The next parameter is the actual printing cursor position passed from SAP to our DLL. This value is relevant for relative positioning:
    Pos:        xpos: 240, ypos: 2050
    
  • And then the bounding rectangle of the barcode:
    Start point: x: 0, y: 2215
    End point:   x: 1016, y: 2050 
    
    The zero-zero point (origin) of the coordinates depends on the used mapping mode. The origin can either be the top left corner or the bottom left corner of the document.

How Can I Optimize the Barcode Quality?

The bar code module width parameter influences the reading quality of the bar code.

Note: Use standard settings for the print ratio e.g. Code-128 has a ratio of 1:2:3:4.

Example: 200 dpi printer

If the printer prints with 200 dpi, set the module width so that it corresponds exactly with an integer multiple of the width of one or more printer pixels. For example, use 1 pixel (which is equivalent to 0.127mm in this case) for 200 dpi.

According to most symbology specifications, a module width below 0.19 mm should be avoided. In such a case, at least 2 printer pixels should be set for bar codes to achieve a module width of 0.254 mm.

If the module width is too small, the bar code width is also too small. Use the following settings:

        3 x 0.127mms = 0.381mms
        4 x 0.127mms = 0.508mms

Conversion table for millimeters to inch:

        0.127 mms  =  0.005 inch (to small)
        0.19  mms  =  0.007 inch (minimum m.w.)
        0.254 mms  =  0.010 inch (2 printer pixel)
        0.381 mms  =  0.015 inch (3 printer pixel)
        0.508 mms  =  0.020 inch (4 printer pixel)

Set the module width based on the above values to avoid resolution errors. If errors still occur (because of minor rounding errors), try using 0.509 instead of 0.508.

You can also use Barcode Studio with the Quality Watch feature to detect printing tolerances and find out the optimal module width value.

For 203 dpi printers see the next FAQ

Barcode Quality Problems with 203 DPI Printers (Zebra etc)

You may encounter bar code quality problems when printing to a thermal transfer printer with 203 dpi

Adjusting the module width to the printer resolution is the standard solution for such problems. But with 203 dpi printers we have one particularity shown by the following example.

Three printer dots at 203 dpi correspond to 0,3753694581 mm. But the module width in the print control can be adjusted to 0.375 mm only (no more fractional digits can be specified). This approach leads to an aberration of 0.000369 mm per bar/space module in the symbol. This sounds like a very small error, but the errors add up and lead to an aberration of one or more printer dots when printing wider bar codes.

Solution

With the OptResolution flag the module width can be reduced to the next full pixel boundaries thus reducing the printing tolerance to a minimum.

  • Edit the barcode.ini configuration file and adjust:
    [SETTINGS]
    ...
    DefOptResolution=1
    
  • Adjust the module width in the Printcontrol slightly above three Pixels: M=376.

This way the Barcode DLL will calculate a "fallback" module width of 0,3753694581 mm (according to 203 dpi) thus avoiding the aberration mentioned above.

SAPSprint - Problems with Slow Printing

Are you using SAPSprint in combination with Windows printer drivers? Please enable SAPSprint debugging as follows (on the command line):

sapsprint -oi LogLevel 5

Normally the processing time is not expended in SAPSprint itself, but in the Windows printer drivers. Some use up a LOT of processing time.

  • Does phase 33 take too long?
  • Does the printer carry out an emulation and are frames or colors printed?
  • There are printers which provide a complete functional emulation of HP LaserJet, but are very slow in executing certain functions.
See SAP Note 15594

SAPSprint Can't Be Started After Barcode DLL Installation

After installing TBarCode/SAPwin into the SAPSprint directory, the service cannot be restarted. In the Event log the following message is displayed:

The SAPSprint service failed to start due to the following error: The service did not respond to the 
start or control request in a timely fashion.

Cause:

This issue is due to a SAPSprint program error when loading the Barcode DLL and occurs with a specific SAPSprint version:

  • SAPGUI 7.20 (Patch Level 0)
  • sapsprint.exe Version 1.0.2.6
  • sapwin.dll Version 1.0.3.1

See also OSS Note# 1461054 (SAPSprint crash with PDFPRINT or BARCODE DLL)

See also SAPSprint change history:

SAPSprint/SAPWIN File Version 7200.x.x.8/7200.x.x.34: 
Bug fix: Crash with BARCODE.DLL
Bug fix: Print empty pages
Optimization: Improved tray selection
Optimization: New version info scheme

Solution:

  • Install the latest SAPSprint patch: xSPrint_1_10008892 (7200.1.2.9 or higher).
  • Please make sure that you use TBarCode/SAPwin with version 6.0.3 / 9.0.1 (or higher).

GS1/EAN-128 Variable Length AI with FNC1

  • Use system barcode BC_EANH or a user specific type ZBC_EANH
  • Make sure that you configured the EAN-128 bar code format in your print control Prefix as follows:
    C=E128,...
    
  • Adjust a placeholder for the FNC1 with the print control parameter %=. Use a placeholder, which is normally not used in AIs - e.g. the exclamation mark %=! or the plus sign %=+
  • Then encode the FNC1 using the placeholder (e.g. the exclamation mark):
    21 + serial number + ! + 11 + production date.
    
    If the serial number is 1234 and the production date is 010108, the encoded bar code data should be as follows:
    211234   FNC1   11010108
    
  • Check if everything works by scanning the bar code with a reader. You can also send your bar code (image scan or PDF) to TEC-IT Support for validation.
EAN128 uses FNC1 character on the first position of the code to mark the bar code as EAN-128 and identify it from Code-128. This is done automatically by TEC-IT Barcode Software, so you don't need to do it manually!

How Can I Run a Silent Setup with TBarCode/SAPwin?

EXE based setup

Use the standard EXE setup program, which is available for public download. You can select the feature you want to install with specific feature options - e.g. if you want to install only the Barcode DLL without documentaton in quiet mode, execute the setup this way:

TBarCode_SAPwin.exe /quiet FeatBin=1 FeatDocu=0

Optional: add parameter AutoDir=0 InstallFolder=C:\WWI to install into a specific directory. You can also suppress installation of the VC++ Runtime with InstallVCRuntime=0

Please run the EXE with option -? to see all available command line options.

TBarCode_SAPwin_EN.exe -?
The setup program contains both the 32 and 64 Bit components, the target directory is determined automatically for SAPSprint and SAP GUI. By default, the setup downloads the Visual C++ Redistributable from Microsoft and installs it if not present. Alternatively you can copy the vc_redist.x86.exe and vc_redist.x64.exe (correct version!) into the setup path if there is no download connection.

MSI based setup

MSI based setups are available for TBarCode/SAPwin V10 and V11 on request. Call the MSI package with the following command line parameters:

Install Barcode DLL for SAPSprint into default directory (use the x64 MSI for 64-bit SAPsprint):

msiexec /i TBarCode_SAPwin.msi ADDLOCAL=FeatBin /qn
msiexec /i TBarCode_SAPwin_x64.msi ADDLOCAL=FeatBin /qn

Install Barcode DLL for SAPGUI (32-bit) into SAPGUI directory (needs Admin console!):

msiexec /i TBarCode_SAPwin.msi ADDLOCAL=FeatBin INSTALLDIR="C:\Program Files (x86)\SAP\FrontEnd\SAPgui" /qn

Install Barcode DLL for SAPGUI (32-bit) into SAPGUI directory:

msiexec /i TBarCode_SAPwin.msi ADDLOCAL=FeatBin SAPWIN_DIR="C:\Program Files (x86)\SAP\FrontEnd\SAPgui" /qn

Install Barcode DLL for SAPGUI 5.0+ (64-bit) into SAPGUI directory (needs Admin console!):

msiexec /i TBarCode_SAPwin_x64.msi ADDLOCAL=FeatBin INSTALLDIR="C:\Program Files\SAP\FrontEnd\SAPgui" /qn

V10 32-Bit: Install Barcode DLL for SAPlpd into default directory:

msiexec /i TBarCode_SAPwin.msi ADDLOCAL=FeatSAPlpd /qn

V10 32-Bit: Install Barcode DLL for SAPlpd into custom directory:

msiexec /i TBarCode_SAPwin.msi ADDLOCAL=FeatSAPlpd SAPLPD_DIR="C:\MySAPlpd" /qn Declaration of parameters:
/i ............ indicates which package is to be installed
INSTALLDIR .... sets the installation directory of SAPSprint/SAPGUI (optional)
SAPWIN_DIR .... sets the installation directory of SAPSprint/SAPGUI/WWI (optional)
SAPLPD_DIR .... sets the installation directory of SAPlpd (optional)
ADDLOCAL ...... indicates which features are installed (comma separated)
                          FeatBin ....... Barcode DLL for SAPSprint/SAPGUI
                          FeatSAPlpd .... Barcode DLL for SAPlpd
                          FeatDocu ...... User Manual
/qn ........... quiet Installation (no dialogs)

You can suppress the feedback page during uninstall with the NO_UI property set to 0.

msiexec /x TBarCode_SAPwin.msi /qb NO_UI=0

More supported parameters are listed here: Windows Installer Command-Line Options

Note: If the directory of SAPSprint or SAP GUI cannot be evaluated, the Barcode DLL will be installed into the program files directory. In quiet mode, all errors are suppressed.

Wrong Host Spool Access Method (HSAM)

Destination computer is not available (HSAM "S")

Please keep in mind that computer and printer name are case-sensitive! Cross-check test: Use the IP address instead of the host name.

In case of thermal printers (like TEC-B482): No ribbon feed.

Use the host spool access method “S” instead of “F”. Therefore you’ll need the name of the computer on which SAPlpd is running (make sure that SAPlpd is already running, SAPlpd does not start automatically when using HSAM “S”!). The share name of the printer is to be indicated as follows:
"\\SAPlpdHostName\PrinterShareName".

No Barcodes with PDF Printer in SAP

There is a difference between printing and PDF generation in SAP:

Printing

The barcode is generated during the spooling process to the printer. The print job is routed through SAPGUI, SAPlpd or SAPSprint and these programs call our Barcode DLL for barcode insertion.

PDF from SAP

With PDF it is different - the SAP PDF Generator generates the PDF completely on the server and here we have no possibility to insert the bar code. SAP PDF inserts no barcode (except "new technology" bar codes), only a text note.

Combination Printing + PDF

The only solution for generating PDF documents with real visible bar codes from the Barcode DLL is a Windows PDF printer software. You print to this printer like a normal printer but the driver of this software generates a PDF instead of a print out.

PDF Printer software is available from several vendors. You should select a tool, which allows server operation and is not dialog based (= generates PDF document names and stores PDF files automatically).

Adjusting a sufficient image output resolution (600 dpi) in the PDF driver is important to get readable barcodes.

Our product TBarCode/SAPwin (Barcode DLL) can create the bar codes ONLY during printing, that means sending the job to a physical printer or any other printer in the Windows system (can be also PDF printer like www.win2pdf.com). This limit is by design of the data flow and spooling process. The SAP integrated PDF generator is not able to create QR Codes or Data Matrix - because IT DOES NOT invoke the Barcode DLL.