Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Can binary data be sent using WRITE?

juan_suros
Contributor
0 Kudos

Does anyone know how I can trick the WRITE command to send binary data to a printer using the WRITE command.

I am writing a driver for an Eltron thermal label printer that supports the EPL2 command language. To send a small graphic (a logo) I use the "GW" command that requires binary data. Other printers (e.g. Zebra with ZPL2 language) accept Hex written as characters, but this one does not.

I've tried putting the necessary bytes into a hex (TYPE X) field but looking at the print spool I see that WRITE has helpfully converted the bytes to their 2 character hexadecimal equivalents. I want to send the bytes instead.

The output device is defined as ASCIIPRI.

Does anyone have any ideas?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI

GOOD

TO THROUGH THE FOLLOING LINKS

http://www.makebarcode.com/info/appnote/app_024.html

THANKS

MRUTYUN

3 REPLIES 3

former_member186741
Active Contributor
0 Kudos

I think the hex/binary issue is a red herring. The data is represented as hex so that human beings can read it quickly - internally the data always occupies the bytes in binary code. Maybe the printer expects the data to be of a specific length and you are not complying. HAve you tried an XSTRING variable or RAW if it's from a dictionary based structure?

Former Member
0 Kudos

HI

GOOD

TO THROUGH THE FOLLOING LINKS

http://www.makebarcode.com/info/appnote/app_024.html

THANKS

MRUTYUN

0 Kudos

Yes, exactly. The PRINT-CONTROL command in ABAP was what I was looking for. The image is now recognizable in printed output.

For future reference of anyone reading this, make sure you define your print control as "Hexadecimal" or it won't work. You will probably have to split the data up across several print controls, also, as the text field is only 58 characters long.

Thank you for your help guys!

Juan Suros

Kyocera International, Inc.