Application Development and Automation 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: 
Read only

Printing Barcodes using ABAP

Former Member
0 Likes
2,461

Hi Abapers,

I Want to Print Barcode using ABAP Write statement. Is it Possible?

Please suggest me.

Thanks,

Kishore

5 REPLIES 5
Read only

Former Member
0 Likes
992

well.....never say never, but I think you need a sapscript/smartform/adobe to print barcodes in SAP.

Read only

0 Likes
992

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.

Read only

Former Member
0 Likes
992

Printing barcode using smartform is vey easy.

if want help regarding that pls ask.

Read only

0 Likes
992

NO, My Requirement is Printing using ABAP Program only not using Smartforms or Scripts.

Read only

0 Likes
992

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:/