Working with Zebra Printers using Smartforms in SAP
One of the requirements in my project was to print Labels on Zebra printers. The labels were designed using Smartforms. For which I faced some challenges and could not find detailed solution document online explaining the way of working with Zebra printers.
So I decide to document my experiences on the way of working with Zebra printers.
Sap has provided some notes for the list of device types that can be used by Zebra. PFB some of the SAP-Note numbers for reference.
1130927 – SAP Printer Vendor Program
1100779 – Participants in the SAP Printer Vendor program
750002 – Support for Zebra label printer (ZPL2)
750772 – Information about the ZPL-II printer driver for Smart Forms.
1696511 – Problems when printing in landscape format on Zebra printers.
1173046 – Printer Vendor Wizard Note: Zebra.
This document is based on the information from the above SAP-Notes. Please note that the conclusions in this document are purely based on my experience and the documentation I came across, so if there is any scope of improvement in this document, then please add your comments where ever needed. It is necessary to have the notes as reference before you proceed any further with the document.
Note: You can either use transaction SNOTE in SAP or the SAP market place to view the contents of the SAP Notes. Link for SAP Market Place is
The Challenges I faced during the development are:
- Which device type to use
- Orientation issues
- Font Issues
- Barcode issues (Printing and Scanning)
Points 3 & 4 are generic to every printer or device type and same approach should be followed when facing such issues.
1) Which device type to use:
The selection of the device type is based on the following 2 factors
- a) DPI resolution of the printer, and
- b) Orientation of the label
SAP-Note ‘750772’ and ‘1173046’ will help you with the selection of device type based on the DPI resolution of the printer.
Now you will have 2 device types, one each from the above 2 Notes. For example let’s assume that the printer has 203 DPI resolution, so the device types that we now have after selection are LZEB2 and YZB200.
2) Orientation issues:
Now you have to decide the orientation of the label. This is again based on the width of the paper feed on the printer. Different printers from Zebra have different widths, ask for the relevant information and then decide based on the below explanation.
Note: Most of the Zebra printers have Continuous media, so height of the label is not a concern, only thing to take into account is the width of the paper feed on the printer.
Before I proceed further I believe you have the basic understanding of the orientations, Portrait and Landscape orientations.
Let’s say the width of the printer paper is 110 MM,
And the specifications for label you are designing is 170 (h) * 110 (w) as below
In this case we use device type LZEB2 only.
For the same printer with a paper feed of width 110 MM,
And the Specification of the label design is 110 (h) * 170 (W) as below
Here the width of the label is bigger than the actual width of the paper feed on the printer, so this requires us to go for Landscape orientation and print the document as below by rotating the label 90 degrees.
But based on the note there is no command in ZPL-II for rotating the whole output. So to achieve this there are 2 options
I. Using Device type LZEB2
II. Using Device type YZB200
Using Device type LZEB2: According to Note 750772 it is not possible to use Landscape orientation with the device types mentioned in this note because there no command in printer language ZPL-II to rotate the whole output of the label by 90 degrees. So always use portrait only.
The work around to achieve the landscape orientation is that there is a command ‘^FWR’ in the ZPL-II printer control language that rotates each individual field by 90 degrees (clockwise). If you insert this command into the output data stream using the mechanism of command nodes in Smartform for each individual field, then we can achieve the rotation of individual fields at printout. Similarly barcode rotation can be obtained by
specifying the rotation option while creating the barcode. But first you have to use portrait orientation only in the Smartform and then design the layout accordingly in the Smartform with a command node with the rotation command for each individual field.
Below Screenshot illustrates the implementation of the above idea in Smartform.
By doing the above you can achieve the rotation of the text written in the text node ‘FROM’ but only while it is being printed on the paper not in the preview. So it is necessary that you have the concerned printer available with you to test, because this is going to take a lot of effort arranging the fonts on the label. For more information please refer to section 2 in note 750772.
Using Device type YZB200: According to note 1696511 it is possible to print in landscape orientation on zebra printers using device type YZB200, but the problem is that the print is not rotated on the printer as below
Instead it is printed like this
So using device type YZB200 it does allow us to print in landscape orientation but to get the correct output the printer paper width should not be less than the width of the label. If the width of the printer is less than the label then the label above is truncated at the end as below
So the understanding from this is that it is possible to print the labels in landscape orientation on Zebra printer, but the width of the paper feed on the printer should be same as the width of the label design else there will be truncation at the end.
So final Conclusion on which device type to use for zebra printers is:
For portrait orientation use – LZEB2
For Landscape Orientation use – YZB200 (But make sure width of the paper feed is not less than the label width)
3) Font Issues:
If you don’t use the correct font in your Smartform then you will have issues printing the label on the printer or while you are seeing a preview using the respective printer (it will work fine with the LOCL/LP01 printer).
In such cases it will give the below error message.
‘Table ‘XYZ’ does not fit into Window’
And this is mainly because, the table (template) ‘XYZ’ in some window cannot accommodate the data and the data inside this window is exceeding the size of the window or the whole page. As written above there will be no issues if you are using LOCL / LP01 device for preview, now the question here is why issues with the other devices ? Let’s not come to a direct conclusion on this, and let’s figure this out by trials.
Now if you try and reduce the size of the template in the window (in Smartform) by half of it then you can see the preview but you will see bigger size letters and may be a different font. That is because the printer does not support the font you have used in the Smartform and by default SAP takes the default font of the printer and uses that in the Smartform and hence you see a bigger font size and possibly a different font style.
So it is advisable to use fonts that are available for the device type associated with the printer.
You can check the printer fonts by using transaction SE73.
Steps to check the printer fonts:
Go to SE73.
Select printer fonts radio button and click display. It will take you to the next screen where all the SAP defined device types and custom device types (newly created or loaded) in SAP are listed.
Select your device type and double click to see the list of fonts available for that device type.
So in this case only Helve is maintained, so it is better to use Helve only in your Smartform, One more thing to know here is no matter what you have in Smartform the print will always have BOLD text only because of the bold settings in the printer font( see screenshot above).
It can have different font Sizes though, I did not have to maintain different sizes in the printer fonts but the labels were printed with their corresponding size.
If your requirement is to have a specific font then you can add that Font to the printer device type and this will be a Basis activity.
4) Barcode issues (Printing and Scanning):
First thing to know about barcodes is that the preview and the actual print from the printer are not the same. So try to adjust your layout based on the printout form the printer and not based on the preview.
Let me show you what I actually meant by this.
Preview in SAP:
Actual printout from the printer:
Both the screenshots above were created using the same barcode CD39__00 barcode, and symbology Code39 but the barcodes in the preview and the actual print are totally different and that is the reason why it is advised to design the layout based on the actual printout from the printer.
The second thing to know about barcodes in SAP is that there are only a few barcode symbologies that are supported by SAP and are available in system by default.
The barcode symbologies supported by SAP are:
These are the basic barcodes types using which we can create a barcode. And SAP has provided few barcodes using these and these are also available in SAP by default.
Both printer barcodes and System barcodes can be checked in transaction SE73 (see below).
Display system barcodes to see the list of barcodes supported by SAP (see below).
The screenshot above shows few of the default barcodes supported by SAP. The barcode highlighted in the above screen was created using the new barcode technology and the others are created using conventional technology. You can also create your own barcodes here. More information regarding how to create barcodes in SAP can be found online.
The next step with barcodes is to check which barcodes are supported by the printer. Let’s assume that your requirement is to use a barcode of symbology Code_39 so first check if the printer has any default barcodes with this symbology.
To check printer barcodes, go to SE73 and display printer barcodes and go to printer LZEB2 and double click to list all barcodes supported by printer device type.
Basically these are standard barcodes that are also supported by SAP. The highlighted ones in the screenshot above use Code_39 symbology. Try using one of these in your layout and see if it meets your requirements and make sure you design the layout based on the actual print form the printer not based on the preview of the Smartform.
Using the barcodes supported by the printer will ensure that they are easily scanable and read by the scanner. If you use any other system barcode which is not supported by the printer then also you will get the barcode printed on the label but we will have issues scanning the barcode. So it is better to stick to using the barcodes provided by the printer.
If listed barcodes does not meet your requirement (may be because you need a barcode with less width or height to accommodate on your label) then you have to create a new system barcode and assign it to the printer device.
This part is dealt in more detail in the document named How to Print Barcodes that are not supported by SAP using Smartforms that is already published.
Apart from this you can also have alignment issues with the barcodes. To align a barcode you can do the following.
- Go to Smartstyle you have used in the program, select the respective node you have assigned for the barcode. Here try changing the alignment and spacing values and try giving it a few trials. You will be able to align barcodes after a few combinations.
- Sometimes if there is not enough space in the column of a template or the table cell then the barcode placed inside them will skip one line and print the barcode in second line. To align the barcode properly with the other barcodes in the adjacent columns you can either increase the size of that column to accommodate the barcode or if that is not possible then reduce the sizes of the other adjacent columns so that the other columns also skip a line. An example for this issue is as below.
In the above screenshot there is an alignment issue with the barcodes but there is no space on the page to increase the size of the 2nd column, to align them we have to reduce the size of the 3rd and 4th columns by adding an empty column, either one empty column each after the 3rd and 4th columns or reduce the size of 3rd and 4th columns a little bit (very nominal) and add an extra column just before the third as shown in the below screen shot.
This will make the barcode shift to the next line in 3rd and 4th columns also. So this will align the barcodes properly as shown in the below screenshot.
—– ‘ THE END ‘ ——
The conclusions in this document are purely based on my experience and the documentation I came across online, so if there is any scope of improvement in this document, then please add your comments where ever needed.
thanks for sharing it.
this doc look very complet ! good job ! thanks for sharing your knowledge 😉
Thanks for your comments 🙂 , i have gained a lot from the information on SCN and it was about time that i started giving back by contributing to the community.
I love documentation like this - real life experience on how, why and results. Kudos to you for writing it and an inspiration to the rest of us to share in the same fashion.
Thanks a lot for your share. currenty, I have problem on label printing with zebra. my label width is LT printer width, but I have no authority to create page format, so I redesign my smartform in rotation 90 degree. after print out, the dimension is correct, but letters are coming garbled and overlaped. another issue is the barcode missing which should display at bottom.
bellow is print preview:
Now I am tired with the letter issues, could you give me your kindly suggestion and warmly help please?
Thanks for your comments.
Now coming to your issue, first of all here you have mentioned that your label width is less than your printer width so in that case there is no need for rotation, rotation is needed if your label width is Greater than your printer width. So try designing with no rotation, i am not sure but using a window of same dimension in the smartform should help you achive the exact label.
Next you have mentioned that you do not have authorization to create a page format, then please find someone who can provide you the authorization for it or may be someone who can create it for you, then you can just use it. it is much easier this way when compared to the rotation process. 🙂
Regarding the grabled and overlapping letters, i would suggest you to increase the size of the window or perhaps reduce the font size and see if you can accomodate it inside the window. ( Hope you are using the fonts supported by the printer if nto load the font on the printer device type). Same goes with the barcode check if there is enough space for the barcode, use barcodes that are supported by the device type. if you are using a custom barcode then check if it is supported by the printer. An example on how to work with custom barcode is demonstrated in one of my documents, please refer the same and here is the link How to Print Barcodes that are not supported by SAP using Smartforms
i would also suggest you to create a test Smartform to only print the concerned barcode and check the print on the zebra printer, try printing it using both ways normal and by rotation and see if it is working. Also check the listed notes one of them also speaks on how to achieve barcode rotation.
let me know if you need any more information, but also provide more details as to which barocde you are using and also let me know if any of my suggestions were helpful, this actually will help others resolve their issues by looking at the comments and probably i will update them in the document later.
Thanks for your quickly reply!
For currently rotation process issues, I'd like to show you some details about my smartform.
I think the windows have enough space for texts, and I had reduced font size, but problem still exsit.
I think the font that I used is supported by printer, please see below scaned before rotated.
For the barcode, main problem is position, it can not align to top-left of page. here I have a simple smartform for test:
following is barcode attribute.
I have no idea for these two issues, I have tried to change style, but it not works. 😐
Maybe I should pay attention to device type, but I am not familiar with that, could you give me more help for this? just create new page format and assign to device type YZB200? what should I do if there is no YZB200 in system?
Please share the view with your positions. ( Second Tab)
Maybe you put there wrong values in.
You have to change the top and the left position. Seems that you didn't check this as issue.
Device type is the key to success when it comes to printing the barcodes on the printer. which device type to use is based on the DPI of the printer and the orientation you are using in your smartform. Please go through the document, it has a step by step approach to find which device type to use, which orientation to use and which barcodes to use.
For barcode printing issues please read section with heading Barcode issues in the document. From your reply it is taken that you have not completely read the document so i suggest you please go through it 🙂 and read the complete document or take a step by step approach.
The important thing with the barcode printing is that you should not be concerned with the alignment in the print preview of the label instead you should check the actual printout from the printer, and if you still have alignment issues in the actual printout then please go through the section in this document that describes how to resolve the alignment issues with barcodes.
I noticed that you are using a custom barcode in your smartform,which is probably the reason why it is not printing on the printer, so the same has to be linked to the device type with proper print control assigned to it, i have already suggested you to go through the document on printing custom barcodes, the link has already been provided in my previous reply. But i suggest you check the supported barcodes from the device type and use one of them (go through the section barcode issues in this document on how to). which device type are u using ? if you are using LZEB2 then i suppose there are a few barcodes with type code_128 and rotation 90 degrees, so try using them instead.
For text issues try adding spaces between letters in your smartform and see if the output is not overlapping.
Loading YZB200 is a basis activity, try searching the market place with YZB200 and you will be able to find notes related to it, of which one of them is related to loading YZB200, pass it on to the basis consultant and he should be able to load it for you.
Kindly help understand this case. The print preview does not show any space but the actual print has a space. We are using smartforms and the device type is LZEB2
Space between 45 and 0, as per the requirement we do not want this space.
Thanks and Regards,
Thanks for the post, very useful!
This is very helpful.
I am trying to achieve the same using Intermec PM43 printer with device type YIM4-203 and having hard time to find proper command. Using the Command Language IPL, characters can be rotated using the command r<n>, but couldn't find any similar command with Direct Protocol printing.
Please help me if you have any idea about Intermec printers.
For those who follow the book (we were aiming to print to ZEBRA GX420D) and still experience problems "Request .... in system ... internal error 0000000028/128 in
spooler (Object not found) /Message no. SP01R042" while trying to print via access method U; although SAP/ZEBRA recommends in OSS note 1173046 to use device driver YZB200, we finally got it working by using device driver LZBE2.... 😕
Thank you very much, very helpfull report.
Some additional items from my Investigation around ZEBRA.
We are using device type YZB200RL successful without the orientation problems.
We added an own formats an page formats in SPAD.
We implemented own Barcode with direct Zebra commands.
The last Problem was to print an grafic from BDS. We have to rotate the grafic before checking into SAP-BDS (SE78).
I am trying to print SAP smartform Landscape format on a Zebra printer using YZB200RL(note 1696511) device type which handles a paper format of 210mm x 80mm (Custom designed page format).
Eventhough the form is landscape declared, it is printing as portrait on the Zebra and the information is truncated as the Label width on the printer is just 80mm (Portrait).
I have my printer connected to network and would like to print on this and not as Local .
Can you please guide me how you were able to achieve this scenario?
pleas try to switch orientation in SPAD transaction:
spad - orientation
Thank you very much for the quick response.
I have the same settings as yours. But still it is not printing properly.
Here my form:
I have the similar settings in smartform.
I got a new beta version of the devce type YZB200/300 from zebra support.
this enable Datamatrix Barcode with new barcode technology and the replacement of some
Invocation Codes to represent non-printable characters (e.g. \GS\ \RS\ \EOT\ \FNC1\)
The positioning of graphic object was improved.
Thanks for the post Umar. Very helpful. Was able to print the label & bar code successfully on the ZEBRA printer.
Issues which i am facing
1. The bar code being printed is not getting scanned. Used the standard bar code BC_CD39
2. The response time of the print while using smartforms is not good. I fire a print and then there is a delay of 20-30 secs before the label is printed. This is in case of a single label print. Not really sure if in real scenario when large number of labels are printed will the delay multiply or remain the same.
Some still use sapscript for printing to Zebra printers and its response is pretty good.
Considering response what's ur recommendation? Go with smartforms or use sapscript?
I present the problem with after the 31 characters, they do not rotate.
I work on SAP version 7.4 and a Zebra GT800 printer.
Someone with an idea? I have already reviewed other publications and the notes are for earlier versions of SAP.
I appreciate any help. !!
How did you able to print the text veritically/Rotate on YZB200 device? we are having a hard time rotating the text.
can you please give me some insight if you are using any printer commands?
My label is setup as Landscape format on YZB200. The ^FWR command is ignored in this device type.
Hi umar jawid ahmed syed ,
Thanks for sharing such great blog. Very informative.
I have a requirement with Zebra Print and looking at your blog thought of asking with you.
We have smartforms designed in SAP and we print those forms on Zebra printers. All this is working fine. Now our new requirement is to get .ZPL (Zebra Print language) from SAP and give it to non sap system, and the print will be given from that non sap system and not from SAP.
Is there any way we get .ZPL file from SAP?
I don't have a solution for you, but have a question. I am working on printing on Zebra ZT420 printer using SmartForms and am having problem printing 'Long Text' maintained via SO10. The text, when printed is overlapping. Not sure if you would have some insights on what might be creating the issue? Here is the link to the question that I have already posted on the community https://answers.sap.com/questions/457465/zt420-sap-smartforms-long-text-print.html
Thanks for sharing such great blog. Very informative.
I have a requirement with Zebra Print and looking at your blog thought of asking with you.
We have smartforms designed in SAP and we print those forms on Zebra printers. It is printing well in DEFAR0007 printer and in DEFAR0358 printer text is missing. Please provide solution for it ASAP.
Thanks and Regards,
Very informative blog. Also I would like to add one more important information, which I have not found in any blog. When we install device type as per note 1173046 - Printer Vendor Wizard Note: Zebra, you need to import some transport request provided by Zebra which contains ABAP driver for ZEBRA, without which spool is not generated( as mentioned by one the user). This transport will install driver YZB1. Unfortunately, transport request is not provided by SAP and we have to download from respective printer support portal.
It's explained in the SAP notes. The official SAP information is not in blog posts but in the SAP notes (mentioned above). The SAP notes can be accessed by all clients with a license. The issue is that many developers are not given access by the clients (or the developers don't know that they can ask the client to have access, or the client doesn't want to give access/doesn't understand how important are the SAP notes). Ask/tell your client 😉
I am just trying to point that along with device type setup, you need ABAP driver setup also. This step is not mention in any of the snotes or blogs. Recently, I installed device type for Toshiba and I had hard time finding the ABAP driver for it.
I didn't mean your comment was useless. I just reacted on your "one more important information, which I have not found in any blog". And my guess was that you didn't look at the notes, because many developers say they don't have a S-user to access them.
(and I think it's the same for other vendors, e.g. SATO note "The device types and device drivers are delivered by SATO at https://www.satoasiapacific.com/product/sap/")
The note 1103422 says "The procedure to install device drivers is to import the transport files provided by the printer vendor into your main development system via transaction STMS..."
You were first talking about Zebra, and now you are talking about Toshiba. For Toshiba, it's the note 1135105 - Printer Vendor Wizard Note: Toshiba Tec. The files are not available at the vendor Web site, but in the note.
Great Document Umar.
I have a question, is there a way to introduce ~JA zebra command(Cancel All) before starting new label print?
My requirement is to clear printer cache before printing current label to avoid wrong label to be printed.
May be adding in Device Type level events.
2.Reset after exit
3.End of page
4.End of line
Hi all!! just to add a little bit of information about RFID vs Smartforms
we are using a Zebra ZD500R printer, with Device type LZEB2, our requirement was print RFID labels, but keeping an actual Smartform.
Finally we got the solution using the new barcode RFIDGEN2 created in SE73
we just insert the information like in a usual barcode and we also activated the functionality of "passthrough" in the printer configuration on windows side.