You are on page 1of 3

Questions for Bar Code Printing in SAP

1. Can we print bar codes in SAP only from ZEBRA printers ?

2. I had read that bar code printing is enabled in SAP and only needs to
configure device/printer for that. Does this mean that we can use our existing HP
2300 or like printers to print bar codes without any ZEBRA like printers and the
printed bar codes are readable through any reader ?

3. Are there any specific steps to print bar codes from SAP (from within
Smartforms) including data fetch and printer configurations.

4. What is the process or method for reading data in bar code form into sap ( as
far as I think that we can upload the txt file created from reader and upload it to
SAP ). Can we do this without uploading TXT file i.e. directly reading from bar
code reader into SAP. In other means what are the normal ways to read bar
codes data into SAP.

Furthermore, we have taken a zebra Z4M plus printer from one of vendor on
trial basis but even after following the recommended steps as mentioned in the
config. manual we are unable to print any thing on bar code printer from within
SAP.

I do agree that we can print bar codes from excel or from outside SAP but we
wanted to print it out from within SAP and we think SMARTFORM is an easier
way as compare to SAPSCRIPT (although we don't have any idea of printing
bar codes from SAPSCRIPTs).

About reading from bar code reader .... yes we know that we have to read the
bar codes into a ASCII or text file but in that case we need to write a ABAP
program to upload that information into SAP to do MIGO (in our case) and for
that we also need to fill in certain other information into that text file after
reading bar codes ....?? is there any other simpler way of doing this ???

We are able to print barcodes from smartforms. Doing this way, we print barcodes on
laser printers.

We are also printing from sap to zebra printers using two ways:
1. Download the data to an excel sheet, then creating a macro that opens the printer
port and sending the commands to the printer through this "file". All this is done via
vb script provided with excel)..
2. The second way is creating a vbscript (an ascii file from sap) with the printer
commands and then runing it using ws_execute.

You need a barcode reader to read the barcodes, and this scanner acts like a keyboard,
it sends the data scanned to the active field on screen. (which might be a notepad,
word, excel or an input field or ... ).

Back to your problem:


1. We're using Zebra 2746-e (Eltron) to print labels that have some barcodes in their
design. There are several approaches to solve this problem. We've decided to work
with the programming language of the printer (EPL-2), because we use the zebra
printers from SAP or from other windows applications.

Our solution was to develope function module that creates an ascii file (a vbscript
file) and then use the ws_execute to run wscript with this file. The vbscript just opens
the port for output and sends a sequence of writeline, each of them with a command to
the printer. After all the commands were sent to the printer, we close the port . Just
note that the port acts the same as a file.

This is an EXAMPLE of the visual basic script code;

Set fs=CreateObject("Scripting.FileSystemObject")
Rem send the output to COM1 port.
Set a = fs.CreateTextFile("COM1:",True)
Comilla = Chr(34)
a.writeline "O"
a.writeline "ZB"
a.writeline ""
a.writeline ""
a.writeline ""
a.writeline "N"
a.writeline ""
a.writeline ""
a.writeline "q800"
a.writeline "Q635,24+0"
a.writeline "R32,24"
a.writeline "S3"
a.writeline "D8"
a.writeline "ZT"
a.writeline ""
rem this is an example of barcode ean128-ucc
a.writeline "B126,429,0,1E,3,3,61,B,""011234567890123410051215"""
rem this is an example of barcode 3 of 9 rotated
a.writeline "B10,495,3,1,3,3,49,B,""01234567"""
a.writeline ""
a.writeline ""
a.writeline "P1"
a.writeline ""
a.Close

We've send this code to an ascii file or as part of a macro to be run within an excel
sheet. We have succeed in both cases.
The zebra printer is created as local to the computer running the vbscript. We haven't
been able to share the zebra printer so other people in the network can use it. And the
zebra printer isn't installed as a SAP printer (we aren't using sap spooler to send jobs
to the zebra). Another Note: zebra 2746 comes with a software bar-one (or something
like that) that allows you to design the barcode label in a wysiwyg way
If my memory isn't failing, I think that I've read something about controlling zebra
printers from smartforms in service.sap.com, but I haven't explored this possibility.

2. From 4.6c on, you can use smartforms to print barcodes without buying any
barcode.dll software nor hardware extention like Bardimm on any laser/inkjet
printer (Please Note that I haven't mentioned Zebra printers here!). To do this,
you have to create a smartstyle -> character format with the desired barcode
font (defined within sap). Then in the smartform, create a window, put the field and
associate it the character format. That's all (I mean, that's all we do at least :-). I think,
you have to consider the barcode specifications before sending the barcode value to
the smartform (Just an example, if you're using 3 of 9, the code should start and end
with an asterisk - '*' -) We're printing an interleaved 2 out of 5 barcode in our invoices
due to a legal requirement, and we did it this way.

3. If you have a barcode scanner, then you should not need reading the barcode into
an ascii file to get the data read in an standard or custom screen field. You can read it
directly to the field you want. (unless... you have complex data coded in the barcode -
for example if you're using an ean-ucc 128 compliant code and you're sending several
fields in a single code ... In this case, an interface is almost mandatory because you
must interpret the data fields according to the ucc standard, split the code into several
fields .... and .... pure programming logic ).
To put it clear: if you have to read, for example, a barcode that holds the legal number
of an invoice using a barcode scanner and this number should be sent to migo-> bktxt
then you don't need an interface. The scanner itself acts like a fast operator entering
the characters using a keyboard and filling in the field.
We're reading barcodes in several places (when we finish each pallet, when we
receive an invoice, and so on. Each case is a different screen. We arent using an ascii
file to read these barcodes. Furthermore, we read the invoice legal number into migo
bktxt field (Head Text)

You might also like