Skip to Content
avatar image
Former Member

How to add BARCODE in HTML EMAIL body

Hi experts,

I want to add BARCODE in email body. I have maintained HTML texts in S010 and generating email but now I want to add BARCODE.

Please suggest me how to add BARCODE in the Email body.

FYI; I am using CL_BCS to send the email.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • which barcode symbology? (not all symbologies are supported natively by SAP, i.e. you may need to use an external software)

    Note that if you want to display the barcode in the body, either you generate the barcode as an image and you embed it in the html body, or you generate it using html borders (see www javascript libraries), or you use SVG, etc.

  • Former Member Sandra Rossi

    Is there any way to generate Barcode Image from sales document number?. Do we have any FM or class?

  • It is possible to generate a few barcode symbologies with SAP, but not all, by using the SAPscript/smartform barcode generation internal subroutines. It has already been answered in the forum. So, if you want C128A for instance, I posted an answer.

  • Get RSS Feed

2 Answers

  • Oct 24, 2017 at 06:59 AM

    You can find some Javascript code on the internet to generate some html/css code to display barcode in html.

    <SPAN style="BORDER-LEFT: black 0.02in solid; DISPLAY: inline-block; HEIGHT: 1in"></SPAN>
    <SPAN style="BORDER-LEFT: white 0.06in solid; DISPLAY: inline-block; HEIGHT: 1in"></SPAN>
    <SPAN style="BORDER-LEFT: black 0.02in solid; DISPLAY: inline-block; HEIGHT: 1in"></SPAN>
    <SPAN style="BORDER-LEFT: white 0.02in solid; DISPLAY: inline-block; HEIGHT: 1in"></SPAN>

    Perform some googling on "html code for barcode generator" and if you have the time convert the javascript to abap... Of course, feel free to post your code in the forum.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 24, 2017 at 05:43 AM

    To generate C128A barcode into a bitmap file, by using the SAPscript/smartform barcode generation internal subroutines, see this answer:

    https://archive.sap.com/discussions/message/16628158

    You can easily embed the image into the HTML body using

    <img src="data:image/bmp;base64,XXX"> by replacing XXX with the bitmap content converted into base 64 (this has been discussed in the forum too).

    EDIT:

    Caution: if the customer's barcode reader cannot read the C128A barcodes, i.e. he wants another barcode symbology like PDF417, this one is not supported by SAP (by those internal routines), so you'll need to use an external software (not SAP). List of supported barcode symbologies are shown in transaction SE73.

    Add comment
    10|10000 characters needed characters exceeded