01-24-2008 8:19 PM
In my abap program a have a string that contains ZPL code. I'd like to send that ZPL code directly to the user's local printer. Is there a way to do this in ABAP? I looked at FM PRINT_TEXT but I'm not sure if that is the best way to do it.
If I were to do this outside of SAP. I would call up the windows command prompt and type:
copy C:\Label.txt LPT1
I just don't know how to do this from ABAP.
Thank you,
01-24-2008 11:35 PM
I found this article but I'm not sure what to use for the print control.
http://mecsw.com/info/appnote/app_024.html
============================================
NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG.
FORMAT COLOR OFF INTENSIFIED OFF.
WRITE:/.
PRINT-CONTROL FUNCTION 'BCPFX'.
WRITE: BAR_CODE1 NO-GAP.
PRINT-CONTROL FUNCTION 'BCPFX'.
WRITE:/.
Edited by: Tony Raimo on Jan 25, 2008 12:37 AM
01-25-2008 5:46 PM
I'm try to set up a print control for device type LB_ZEB2. However, I'm not sure what to put for the control charatcer sequence. Here is my code:
FORM test_print using barcode.
DATA PARAMS LIKE PRI_PARAMS.
DATA: DAYS(1) TYPE N VALUE 2,
COUNT(3) TYPE N VALUE 1,
VALID TYPE C.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
DESTINATION = 'LABL'
COPIES = COUNT
LIST_NAME = 'TEST'
LIST_TEXT = 'Test NEW-PAGE PRINT ON'
IMMEDIATELY = 'X'
RELEASE = 'X'
NEW_LIST_ID = 'X'
EXPIRATION = DAYS
LINE_SIZE = 79
LINE_COUNT = 23
LAYOUT = 'X_PAPER'
SAP_COVER_PAGE = 'X'
RECEIVER = 'SAP*'
DEPARTMENT = 'System'
NO_DIALOG = ' '
IMPORTING
OUT_PARAMETERS = PARAMS
VALID = VALID.
IF VALID <> SPACE.
*NEW-PAGE PRINT ON IMMEDIATELY 'X'.
NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG.
FORMAT COLOR OFF INTENSIFIED OFF.
WRITE:/.
PRINT-CONTROL FUNCTION 'BCPFX'.
WRITE: barcode NO-GAP.
PRINT-CONTROL FUNCTION 'BCSFX'.
WRITE:/.
endif.
ENDFORM.
01-28-2008 5:52 PM
Can someone please point me in the right direction? Is there any documentation out there on this?
Thank you
Edited by: Tony Raimo on Feb 8, 2008 1:04 AM
02-08-2008 1:27 AM
Hi,
I have worked on Zebra label printing for developing few lables.
I used to design the label in ZPL software and then download the SAP codeand then copy the SAP code into a standard text.
If this standard text is associated with the transatcion then it would get triggered directly else if the transaction is associated with a SAP script then we would change the SAP script name that was called to our Z script and inside the script we used to call the standard text.
I am not sure whether this helps you.Please let me know if you need anything else.
Thanks,
Avanish Joshi
02-11-2008 6:30 PM
How do you print to a zebra printer directly (No Sapscript)? I have all of the ZPL code in a string varialble in my ABAP program. Is there any way to print the string to the printer directly?
Thank you,
Edited by: Tony Raimo on Feb 13, 2008 7:33 PM
07-28-2010 11:15 AM
You can use FM JIT03_WRITE_TEXT_TO_SPOOL.
For example :
REFRESH textlines.
CLEAR textlines.
textlines-tdline = 'N'.
APPEND textlines.
APPEND textlines.
CLEAR textlines.
textlines-tdline = 'ZB'.
APPEND textlines.
STORAGE bin*************************************************
CLEAR textlines.
textlines-tdline = 'A30,18,0,4,1,1,R," STORAGE "'.
APPEND textlines.
CLEAR textlines.
textlines-tdline = 'A30,46,0,4,1,1,R," BIN "'.
APPEND textlines.
CLEAR textlines.
textlines-tdline = 'P1'.
APPEND textlines.
CALL FUNCTION 'JIT03_WRITE_TEXT_TO_SPOOL'
EXPORTING
TITLE_IV = title
SPOOL_DATASET_IV = spool_dataset
ORDER_NAME_IV = order_name
DEPARTMENT_IV = department
pdest_iv = pdest
NO_DIALOG_IV = 'X'
TABLES
textlines_it = textlines
EXCEPTIONS
print_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
08-27-2010 1:46 PM
Hi Tony ,
I am also facing the same problem , i want to send my ZPL code direct to printer with out any spool amin .
If you found some solution , then please update me .
I will check your reply on same question .
Thanks 'n' Regards ,
Nilesh
08-27-2010 6:09 PM
01-25-2011 8:10 PM
This thread has been open a long time, but here's a solution with minimal overhead. The only limitation is that the variable "output_device" must have the "Short name" for the printer; i.e., the 4 character name.
The Zebra printer (ZL in this case) has been defined as type ASCIIPRI ("Some generic ASCII printer"), because the printer simply takes the text characters and interprets them as ZPLII commands - you don't want any conversions of the ZPLII characters ^ or ~ by the printer driver.
REPORT Y_TEST_PRINT_TO_ZEBRA.
DATA: output_device(4) TYPE C.
output_device = 'ZL'.
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 'X_PAPER'
NEW LIST IDENTIFICATION 'X'
SAP COVER PAGE SPACE
NO DIALOG
NO-TITLE
NO-HEADING.
WRITE: / '^XA'.
WRITE: / '~SD15^LH10,10'.
WRITE: / 'FO100,050B3N,N,100,NFDPPARTNO-1FS'.
WRITE: / 'FO150,200AD,75FDPARTNO-1FS'.
WRITE: / '^XZ'.
NEW-PAGE PRINT OFF.
01-25-2011 8:32 PM
Or
You could use function module 'GUI_DOWNLOAD' to create a bat file with your ZPLII commands.
Then execute the bat file using function module 'GUI_EXEC'.
Bruce