‎2009 Mar 26 10:44 AM
Hi Abapers,
I Want to Print Barcode using ABAP Write statement. Is it Possible?
Please suggest me.
Thanks,
Kishore
‎2009 Mar 26 11:44 AM
well.....never say never, but I think you need a sapscript/smartform/adobe to print barcodes in SAP.
‎2009 Mar 26 11:50 AM
Printing barcodes from a SAP script is quite easy, but how can we print it with a WRITE statement? The following ABAP code is a tested solution, which prints barcodes (type ARTNR -code 128) on Kyocera (F800-FSxxxx series) laserjet printers. For other types of printers find the printer control and driver info from the user manual and define it your report.
Example Code:
data: begin of precom9, "command for printer language PRESCRIBE
con1(59) value
'!R!SCF;SCCS;SCU;SCP;FONT62;UNITD;MRP0,-36;BARC21,N,''123456''',
con3(55) value
',40,40,2,7,7,7,4,9,9,9;MRP0,36;RPP;RPU;RPCS;RPF;EXIT,E;',
end of precom9.
...................
*replace 123456 of precom9+52(06) with the actual material number..
.....................
new-page print on. "barcode printer
Write: 'material number', precom9. "barcode for matnr
new-page print off.
‎2009 Mar 26 11:56 AM
Printing barcode using smartform is vey easy.
if want help regarding that pls ask.
‎2009 Mar 26 12:04 PM
NO, My Requirement is Printing using ABAP Program only not using Smartforms or Scripts.
‎2009 Mar 26 12:17 PM
Printing Barcodes with ABAP or SAPSCRIPT
hope u will get some idea.
We are now ready to print barcodes using an ABAP report program or a SAPSCRIPT form. In these examples we are using Code 39 barcodes which require very little formatting (all we have to do is add asterisks before and after the data).
Sample ABAP Program:
DATA: BAR_CODE1(16) VALUE `ABC01230123A01'
NEW-PAGE PRINT ON IMMEDIATELY `X'.
FORMAT COLOR OFF INTENSIFIED OFF.
If the barcode is the first element on the page, the following Write
statement is needed (otherwise you get a date in the first print
control.
WRITE:/
Turn on the barcode font, print the data, and switch back to the
printer's default font. Be sure to use NO-GAP to avoid unwanted
characters or CR/LF.
PRINT-CONTROL FUNCTION `BCPFX'
WRITE: BAR_CODE1 NO-GAP
PRINT-CONTROL FUNCTION `BCSFX'
Add a Write statement to prevent insertion of CR/LF into the barcode.
WRITE:/