SAP R/3 OSS NOTE 197177
FOR 2D BARCODE PRINTING

SAP-Hinweis Nr. 197177
_____________________________________________________
Printing 2-D bar codes with SAPscript
Komponente BC-SRV-SCR
SAPscript
_____________________________________________________
Langtext
Symptom 
How can 2-D bar codes (for example, PDF417) be printed from SAPscript-forms?

Additional key words
SAPscript, 2-D bar code, PDF417

Cause and prerequisites
There is a need for this information.

Solution
As outlined in Note 5196, SAPscript supports printing bar codes if bar code functions are supported by the output device being used (for example, a printer which is able to print bar codes or bar code software).
The number of characters which are coded in a barcode are limited for one dimensional bar codes which are supported in SAPscript. Therefore SAPscript has an upper limit of 70 characters which can be maximally transferred as data to be output for a bar code.
Because 2-D bar codes such as PDF417 are used to encode substantially larger datasets (between a few hundred to more than one thousand lines per bar code), problems occur in SAPscript when you use this “large” bar code data.
This note serves to demonstrate a practical workaround to avoid this restriction.

Supported products/printers:
The following products are supported for printing 1-D or 2-D bar codes from SAPscript to laser printers (Note 5196):
Jetmobile BarDIMM products (previously JetCAPS BarDIMM) for supported printers
(Note 121305) Lexmark OPTRA Bar code SIMM for Lexmark Optra Laser printers (Note 119471) 1-D barcodes are supported on all Kyocera PRESCRIBE printers. The method described below, however, cannot be used for Kyocera PRESCRIBE printers (SAP device types KYOFxxxx).
Printing 2-D bar codes with label printers:
Note 135894 gives information on printing labels from SAPscript. The printer/label programs mentioned in the related notes usually support printing 2-D bar codes.
General notes on the procedure for 2-D bar codes and SAPscript:
You must consider the following points when you layout a SAPscript form in which you want to output a PDF417 2-D bar code. The bar code string to be output must not contain a line break (this would lead to an error in the printer access of bar code firmware).
Therefore, the string must fit into a single line of the current form window. For this reason, you should select the smallest possible (that is the narrowest possible) font.
Note: Since most device types do not support fonts smaller than 6 point copy the device type to Zxxxxxx (Note 3166) and create a printer font COURIER 020 _ _ 99.99 CPI SF999 SF999 (Note 12462).
Use this font as font for the bar code text (print control SF999 should not contain any print command). Due to the scale interval of 99.99 cpi (character by inch) you can enter 799 characters as barcode data in the SAPscript form when the window size is 8 inch until a line break occurs.
To use the new printer font a system font COURIER 020 _ _ has to be defined in Transaction SE73. After this, define a character format with font attributes COURIER 020 in the SAPscript form.
the printer command for activating the bar code function of the printer is either stored completely or partly in a print control called in the form prior to the bar code string to be output.
to avoid that the SAPscript printer driver inserts a font command between the first print control and the bar code string a blank character (<32>) needs to be output before the print control. This forces the font switch prior to the font control
The printer command for deactivating the bar code function of the printer must be called with a print control at the end of the bar code string to be output.
Example for PDF417 and Jetmobile BarDIMM:
/: DEFINE &XDIM& = 2
/: DEFINE &YDIM& = 3
/: DEFINE &MODHEIGHT& = 3
* <FS><32>
/: PRINT-CONTROL SESCP
= (s1p&XDIM&,&YDIM&,&MODHEIGHT&,0s24850T
= &BARCODEFIELD1&&BARCODEFIELD2&
/: PRINT-CONTROL SBS01
regular text continues here
With the code mentioned above the content of the fields BARCODEFIELD1 and BARCODEFIELD2 is output as PDF417 bar code. HPLJ4/HPLJ5/HPLJ4000 must be used as a device type. The character format FS activates in this case the smallest possible font (without modification point 6) when using the modification mentioned above (point 2).
In this case, the complete printer command for PDF417, ESC(s1p2,3,3,0s24850T may alternatively be stored in a privately defined print control ZPDF4.
In this case, the SAP device type needs to be copied to Zxxxxx and modified accordingly. The example would then read:
* <FS><32>
/: PRINT-CONTROL ZPDF4
= &BARCODEFIELD1&&BARCODEFIELD2&
/: PRINT-CONTROL SBS01
regular text continues here
You can find the meaning of the individual parameters of the PCL-5 printer commands for PDF417 in the documentation for Jetmobile BarDIMM.

_____________________________________________________
Hinweis ist releaseunabhängig
Weitere Komponenten
BC-CCM-PRN-DVM
Geräteverwaltung
_____________________________________________________
Verweise auf verwandte Hinweise
Nummer Kurztext
_____________________________________________________
497491 Printing bar codes of any length
5196 Printing bar codes with SAPscript
135894 Label printing on thermal (transfer) printers