Tuesday, July 9, 2013

SAP Smartforms + Zebra printer = QR codes work

Personally I did some research for myself concerning possibilities to print QR codes within SAP Smartforms. The result was not so happy. There is no direct support from SAP for QRs in Smartforms these days, I mean year 2013.

Possible ways are as follows:

  • The solution from third parties 

  Zebra Designer – NiceLabel software
  http://www.nicelabel.com/products#designer

  • OR ??? ...read below...

QR code printing on Zebra printers

I did many various tests and spend enough time with Zebra support as well. My aim was to avoid any third party tools. Solution is finally no so difficult. The answer is Smartforms "Command node" and ZPL language of Zebra printers. 

Wee need following commands:

  • Position of QR on label
Any ZPL II command inserted into smart form via “command node” is not positioned in the end by smartform's window, but by another ZPL command FO e.g. ‘^FO100,100’.
  • Data - QR content
QR code data must be inserted as command node attribute just by one variable (here e.g. GV_QR_ZPL_CODE). I found this SAP info below and it started to work.
  • Avoid
Although many examples on internet uses starting and ending ZPL commands, but in smart forms you have to avoid of usage such a ZPL sequence ^XA… ^XZ, because it starts new label. It means, QR code is then going to be printed on separate label!


Now put everything together

1. Prepare data for QR in Smartform designer



2. Insert command node, that’s all

It could be placed under MAIN window. I used another window just for imagination of position within designer.




The only limitations is lengh for one Command node content. It is up to 200 characters including ZPL. But for many cases it is sufficient.



2 comments:

  1. Hi Karel,

    I would like to know how to send multiple commands (more than 200 characters). Please advise.

    ReplyDelete
    Replies
    1. To be honest I do not know a way how to overcome this silly limit. You can divide the content into more QRs. Newer versions of SAP already support QR natively. As a temporary solution you can use some third party software as well tested Suchy MIPS barcode software.

      Delete