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 Barcode with WRITE Command

Former Member
0 Likes
2,150

Dear all

I have an old program where we print forms on a matrix printer.

we use simply WRITE: /48 kna1-name1.

Now I have to add a barcode. Is this possible without using Sapscript or Smartforms?

Herbert

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,156

Hi Herbert,

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

Regards

Amarnath S

4 REPLIES 4
Read only

Former Member
0 Likes
1,157

Hi Herbert,

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

Regards

Amarnath S

Read only

0 Likes
1,156

I tried this, but it prints 'ABC01230123A01' and not a barcode

Herbert

Edited by: Herbert Schlup on Aug 31, 2010 1:29 PM

Read only

0 Likes
1,156

HI,

i'm facing the same problem, do you know how to resolve this issue, i did what they suggest but it doesnt work.

thank you for you help,

Read only

Former Member
0 Likes
1,156

Hi,

please go through this ..

Printing Barcodes with ABAP

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

Regards,