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

Barcode in sapscript

Former Member
0 Likes
746

Hi all,

Can anyone tell me the way to add a barcode in SAPScript withour using any third party tool.

I downloaded a barcode font and added it to font family using se73.

I then created a barcode character format using that in script.

But still only a black box is displayed in the script.

I dont know whick process i missed.

Can anyone tell the step by step procedure for barcode printing.

Thanks in advance.

Viswanath Babu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
622

Dear Vishanath Babu;

You need a barcode reader device with the appropriate transfer programs.

To be able to transfer the data from the barcode reader to the R/3 System, use the PM-PCS Interface. If you want to create automatically malfunction notifications for the measurement document, use the customer exit IMRC0001.

If you want to print out barcodes from the R/3 System using SAPscript, you can find out about the prerequisites for doing this in the Online Service System note 5196.

Please go to this link for more details.

http://help.sap.com/saphelp_47x200/helpdata/en/d9/4a94c851ea11d189570000e829fbbd/content.htm

http://help.sap.com/saphelp_47x200/helpdata/en/ca/d45a12900d11d29e8b0000e8323350/frameset.htm

About Syntax in a form window:

<b> /: PERFORM <form> IN PROGRAM <prog>

/: USING &INVAR1&

/: USING &INVAR2&

......

/: CHANGING &OUTVAR1&

/: CHANGING &OUTVAR2&

......

/: ENDPERFORM</b>INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.

OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.

The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:

<b>FORM <form> TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

...

ENDFORM.</b>

The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.

The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.

From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.

Definition in the SAPscript form:

/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO

/: USING &PAGE&

/: USING &NEXTPAGE&

/: CHANGING &BARCODE&

/: ENDPERFORM

/

/ &BARCODE&

Coding of the calling ABAP program:

REPORT QCJPERFO.

FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

DATA: PAGNUM LIKE SY-TABIX, "page number

NEXTPAGE LIKE SY-TABIX. "number of next page

READ TABLE IN_PAR WITH KEY ‘PAGE’.

CHECK SY-SUBRC = 0.

PAGNUM = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.

CHECK SY-SUBRC = 0.

NEXTPAGE = IN_PAR-VALUE.

READ TABLE OUT_PAR WITH KEY ‘BARCODE’.

CHECK SY-SUBRC = 0.

IF PAGNUM = 1.

OUT_PAR-VALUE = ‘|’. "First page

ELSE.

OUT_PAR-VALUE = ‘||’. "Next page

ENDIF.

IF NEXTPAGE = 0.

OUT_PAR-VALUE+2 = ‘L’. "Flag: last page

ENDIF.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDFORM.

Hope it helped you.

Cheers....

Afsal

2 REPLIES 2
Read only

Former Member
0 Likes
623

Dear Vishanath Babu;

You need a barcode reader device with the appropriate transfer programs.

To be able to transfer the data from the barcode reader to the R/3 System, use the PM-PCS Interface. If you want to create automatically malfunction notifications for the measurement document, use the customer exit IMRC0001.

If you want to print out barcodes from the R/3 System using SAPscript, you can find out about the prerequisites for doing this in the Online Service System note 5196.

Please go to this link for more details.

http://help.sap.com/saphelp_47x200/helpdata/en/d9/4a94c851ea11d189570000e829fbbd/content.htm

http://help.sap.com/saphelp_47x200/helpdata/en/ca/d45a12900d11d29e8b0000e8323350/frameset.htm

About Syntax in a form window:

<b> /: PERFORM <form> IN PROGRAM <prog>

/: USING &INVAR1&

/: USING &INVAR2&

......

/: CHANGING &OUTVAR1&

/: CHANGING &OUTVAR2&

......

/: ENDPERFORM</b>INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.

OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.

The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:

<b>FORM <form> TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

...

ENDFORM.</b>

The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.

The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.

From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.

Definition in the SAPscript form:

/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO

/: USING &PAGE&

/: USING &NEXTPAGE&

/: CHANGING &BARCODE&

/: ENDPERFORM

/

/ &BARCODE&

Coding of the calling ABAP program:

REPORT QCJPERFO.

FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

DATA: PAGNUM LIKE SY-TABIX, "page number

NEXTPAGE LIKE SY-TABIX. "number of next page

READ TABLE IN_PAR WITH KEY ‘PAGE’.

CHECK SY-SUBRC = 0.

PAGNUM = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.

CHECK SY-SUBRC = 0.

NEXTPAGE = IN_PAR-VALUE.

READ TABLE OUT_PAR WITH KEY ‘BARCODE’.

CHECK SY-SUBRC = 0.

IF PAGNUM = 1.

OUT_PAR-VALUE = ‘|’. "First page

ELSE.

OUT_PAR-VALUE = ‘||’. "Next page

ENDIF.

IF NEXTPAGE = 0.

OUT_PAR-VALUE+2 = ‘L’. "Flag: last page

ENDIF.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDFORM.

Hope it helped you.

Cheers....

Afsal

Read only

former_member221770
Contributor
0 Likes
622

Viswanath,

First of all you need to make sure that your printer can print the bar code fonts. Some printers need special drivers, while other printers need a special SIMM(??) card. I usually check this out with the BASIS consultant.

Hope this helps.

Cheers,

Pat.