# How can I print a SSCC with GS1-128 (EAN-128) barcode?

**URL:** <https://faq.inetsoftware.de/t/how-can-i-print-a-sscc-with-gs1-128-ean-128-barcode/32>\
**Category:** i-net Clear Reports\
**Created:** [September 4, 2015, 8:26am UTC](https://faq.inetsoftware.de/t/how-can-i-print-a-sscc-with-gs1-128-ean-128-barcode/32 "2015-09-04T08:26:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VolkerBerlin](https://faq.inetsoftware.de/user_avatar/faq.inetsoftware.de/volkerberlin/32/15_2.png) [@VolkerBerlin](https://faq.inetsoftware.de/u/VolkerBerlin)\
**Post date:** [September 4, 2015, 8:26am UTC](https://faq.inetsoftware.de/t/how-can-i-print-a-sscc-with-gs1-128-ean-128-barcode/32/1 "2015-09-04T08:26:16Z")

</div>

I need to print a Serial shipping container code (SSCC) in my report GS1-128 barcode. The former correct name was EAN-128.

I have a company code “37610425” and a list of increment numbers.

The JBarcodeBean supports only Code-128.

---

<div class="post-metadata">

**Author:** ![VolkerBerlin](https://faq.inetsoftware.de/user_avatar/faq.inetsoftware.de/volkerberlin/32/15_2.png) [@VolkerBerlin](https://faq.inetsoftware.de/u/VolkerBerlin)\
**Post date:** [September 4, 2015, 8:39am UTC](https://faq.inetsoftware.de/t/how-can-i-print-a-sscc-with-gs1-128-ean-128-barcode/32/2 "2015-09-04T08:39:33Z")

</div>

The code GS1-128 is a Code-128 but with a specific content structure. See the [Wikipedia](https://en.wikipedia.org/wiki/GS1-128) for more details.

To create the structured data for a SSCC you can use the follow user defined function in your report:

```
// company: must be 8 charcters with your company number
// number: the container number
Function ( StringVar company, NumberVar number )
    if( length( company ) <> 8 ) Then (
    debug( "Error: Company name must have 8 characters: " + company );
    "";
    ) Else (
    Local StringVar digits := company + ToText( number, "000000000" );
        Local NumberVar l := length(digits);
        Local NumberVar i := l;
    Local NumberVar s := 0;
    while i > 0 do (
        Local NumberVar v := Val( mid(digits, i, 1 ) );
        Local NumberVar m := (l - i) mod 2;
        If ( m = 0 ) Then
    	    s := s + 3 * v
        Else
    	    s := s + v;
        i := i - 1;
    );
    s := (10 - (s mod 10)) mod 10;
    Chr(128) + "00" + digits + ToText( s, "0" );
)

```

The final `mod 10` ensures that the check digit is `0` when the weighted sum is divisible by 10, as required by the [GS1 check-digit calculation](https://www.gs1.org/services/how-calculate-check-digit-manually). The SSCC itself has 18 digits; the function also adds the FNC1 character and Application Identifier `00` for the GS1-128 barcode.

This function can you use in a formula like:

```
GS1SSCC("37610425", 2123456)

```

This example produces the SSCC `376104250021234569`. For `GS1SSCC("37610425", 2123459)`, the weighted sum is `110`, so the check digit is `0` and the SSCC is `376104250021234590`.

You can use the [eancheck GS1-128 parser](https://eancheck.com/gs1-128-parser) to check the Application Identifiers and SSCC check digit in your GS1-128 data.

This formula use you in a the “code” formula of the JBaracodeBean. The codeType set you to “CODE 128”.

---

<div class="post-metadata">

**Author:** ![VolkerBerlin](https://faq.inetsoftware.de/user_avatar/faq.inetsoftware.de/volkerberlin/32/15_2.png) [@VolkerBerlin](https://faq.inetsoftware.de/u/VolkerBerlin)\
**Post date:** [September 4, 2015, 8:42am UTC](https://faq.inetsoftware.de/t/how-can-i-print-a-sscc-with-gs1-128-ean-128-barcode/32/3 "2015-09-04T08:42:40Z")

</div>

Since version 15.1 you can also use the ZxingBarCodes instead the JBarcodeBean. Then you must replace the “Chr(128)” with “Chr(241)” in the user defined function.
