Hi all,
We are printing shipping labels from UPS, with a process where we recive the ZPL label code directly from UPS, and we just need to pass the data to the printer to get the labels. We have already implemented this with Fedex and some custom labels, and it works perfectly. The problem with the UPS label data is that it contains non-printable characters (in the MaxiCode data field). When passed to the SAP printer spooler (see code example below), the data gets corrupted because SAP interprets these non-printable characters as printer control codes.
I have verified this by saving the ZPL data to a local file, before printing it through the SAP spooler. I then print this raw data and compare the output with the labels printed from the spooler. The MaxiCode (the big 2D barcode) is different in these labels. UPS has also tested the labels, and rejected them because of incorrect data in the barcode.
For printing, we are using printers defined as type "PLAIN", but I also tried using the "LZEB2" device type with the same result. The error we see in the spooler entry is this:
Print ctrl S_0D_ is not defined for this printer. Page 1, line 2, col. 2201
Print output may not be as intended
The printer ctrl code differs, depending om the label. I have examined the spooler data in "raw" mode, and there is always an ASCII character 28 (hex 1C) in front of the characters that SAP think are control codes, and this is why I think these non-printable characters are the reason for the problems.
This is the function module I use to print the ZPL data (and as stated above, this works fine for Fedex and custom labels). The ZPL data is converted to binary format before passed to the function module, but I also tried to send the data in text format with another FM, but the result is the same. I have experimented with the "codepage" parameter, and this one gives the least amount of errors, and some labels actually get through without errors. But still at least 50% of the labels gets corrupted, with log entries like above.
CALL FUNCTION 'RSPO_SR_WRITE_BINARY' EXPORTING handle = lv_spool_handle data = lv_label_line_bin length = lv_len codepage = '2010' EXCEPTIONS handle_not_valid = 1 operation_failed = 2 OTHERS = 3.
Does anyone know if there is a way to send data to the spooler without character conversion or interpretation of printer control codes? Or is there any other smart way to get around this problem?
/Leif