Guides · SAP Business One ·
GS1-128 barcodes in SAP Business One: what is in the label, and how a scanner reads batch and expiry in one go
A GS1-128 label on an incoming pallet carries the item, the batch, the expiry date and the quantity in one barcode. Scanned well, that is one scan per line instead of four fields typed. This guide explains what is in the code, what B1 does with it, and what a scanner app has to do in between.
Koonsultancy
What a GS1-128 barcode contains.
GS1-128 (the old name is EAN-128) is a Code 128 barcode with a structure inside. The content is a list of application identifiers, AIs: a two- to four-digit number that says what the next piece of data means. Printed under the bars they appear in brackets. The ones a warehouse meets every day:
- (01) GTIN, the 14-digit item number. An EAN-13 is the same number with a leading zero.
- (02) the GTIN of the items inside, used on a pallet label together with (37).
- (00) SSCC, the 18-digit serial number of the pallet or box itself.
- (10) batch or lot number, up to 20 characters.
- (17) expiry date, (15) best-before date, (11) production date, all as YYMMDD.
- (21) serial number of the item.
- (30) count of items, (37) count of items in the logistic unit, (310n) net weight in kilograms with n decimals.
A label might read (01)08712345678906(17)271231(10)ABC123(37)48: forty-eight pieces of that item, batch ABC123, expiring on 31 December 2027. Fields with a fixed length, like the GTIN and the dates, simply follow each other. Fields with a variable length, like the batch, end with an invisible separator character (FNC1). That character is the reason a GS1 code should reach the app as a message and not as keystrokes: typed into a field, the separator is lost and the batch and the quantity run together.
The same AIs appear in GS1 DataMatrix and GS1 QR, the square codes on small packaging and in healthcare. A scanner with a 2D imager reads all three; the app sees the same list of AIs.
What SAP Business One stores.
B1 has a good home for every piece of that label. The item master has a barcode field, and the Bar Codes table underneath it holds any number of barcodes per item, each tied to a unit of measure: the EAN on the piece, the GTIN on the box, another on the pallet. Batch numbers live on the document line, with an expiry date, a manufacturing date and an admission date per batch. Serial numbers likewise.
What B1 does not do is read the label. Scan a GS1-128 into the B1 client with a keyboard-wedge scanner and the whole string lands in whichever field has the cursor. The SSCC has no standard field on a B1 document at all. Taking the label apart is the job of the scanner app.
What a scanner app does with one scan.
- Recognise the code as GS1, from the symbology the scanner reports or from the first AI, and split it into AIs.
- Look the GTIN up in B1's item barcodes. A 14-digit GTIN with leading zeros is the same item as its EAN-13 or EAN-8, so the app tries both. If the barcode belongs to the box unit, the quantity is converted to pieces.
- Put (10) in the batch field, with (17) as the expiry date, so a new batch is created with the right date and an existing one is selected.
- Prefill the quantity from (37) or (30), and let the user correct it if the pallet was broken.
- Treat (21) as the serial number for items that are serial-managed.
- Keep the SSCC as a reference in the remark, or ignore it. Without a WMS there is nowhere in B1 to put it.
Done right, receiving a mixed pallet becomes one scan per label. Done wrong, the operator gets a batch number with the quantity glued to the end and has to retype it anyway.
Printing your own GS1-128 labels.
You need your own labels when suppliers don't deliver them, when you produce, or when you repack. Two things to know. A real GTIN needs a GS1 company prefix, which you get through membership of GS1 in your country; for labels that never leave your building, an internal number is fine, and GS1 reserves number ranges for exactly that. And an item without a GTIN cannot have a (01), so its label gets a plain Code 128 of the item code, with a second barcode for the batch or serial number.
On the printer side: any label printer that accepts a PDF works with a scanner app that prints PDFs, over the network or through the device's print menu. Some label printers only speak their own language (ZPL on Zebra, for instance); check with the supplier before you buy one for a PDF workflow.
A checklist for your warehouse.
- Ask your suppliers for GS1-128 on cartons and pallets; most of the bigger ones already print it.
- Fill the Bar Codes table in B1 per unit of measure, not just the one barcode field on the item.
- Switch on batch management with expiry dates for anything perishable, and decide whether a batch is required at receipt or at issue.
- Use scanners with a 2D imager; see the guide on scanners.
- Choose a scanner app that takes GS1 codes apart and ask which AIs it reads.
How KScan reads and prints GS1.
KScan recognises GS1-128, GS1 DataMatrix and GS1 QR from the scanner's symbology prefix, the separator or the bracket form, and reads the AIs for GTIN, SSCC, batch, the dates, serial number, counts and net weight. The GTIN is matched against the item barcodes in B1 per unit of measure, the batch and expiry go on the line, (37) or (30) fills the quantity. It also prints labels: a GS1-128 with (01)(17)(10) or (21) for items with a GTIN, a Code 128 for items without, and bin labels, as a PDF to a network printer or through the device. All about KScan.