Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
stephen_xue
Active Participant
10,303

Introduction


The normal way to print a barcode or a string to a zebra printer is via smartform or interactive form. However there are some cases the request doesn't come from any forms, but to print the ZPL directly in the zebra printer. Here are the steps for a sample 'Hello World'  building from scratch.

1.Configure the printer in the SAP system.


tcode: SPAD

Enter a new name for the printer and click display


click the create button as below


 

since the output device is used to print ZPL directly, we will not select the device type for converting forms into ZPL. Please manually select LB_ZEB. My printer is ZM400. Assume this type is univeral for most of the Zebra Printers.


 

configure the access method


 

record the short name 'ZB01'.

2. ABAP program prining 'Hello World' to the Zebra Printer


REPORT ytest_print3.

DATA: output_device(4) TYPE c.
output_device = 'ZB01'. " The device short name

NEW-PAGE PRINT ON
DESTINATION output_device
COPIES 1
LIST NAME space
LIST DATASET space
IMMEDIATELY 'X'
KEEP IN SPOOL 'X'
LINE-COUNT 60
LINE-SIZE 100
LAYOUT 'G_RAW'
NEW LIST IDENTIFICATION 'X'
SAP COVER PAGE space
NO DIALOG
NO-TITLE
NO-HEADING.

"zpl
WRITE: / '^XA ^PW800'.
WRITE: / '^FO50,60^A0,40^FDHello World!!^fs'.
WRITE: / '^fo60,120^by3^bcn,60,,,,a^fd1234567890ABC^fs'.
WRITE: / '^FO25,25^GB480,200,2^FS'.
WRITE: / '^XZ'.

NEW-PAGE PRINT OFF.

 

Conclusion


By this means, you will get 'Hello World' to be printed on the sticker via the Zebra Printer. Wish you find it useful.
6 Comments
Labels in this area