Goods Receipt Barcode Batch and Package Label Printing Program
Short answer: A custom output program that automatically prints a barcode label with material, batch, quantity, vendor, purchase order and receipt date for each item when a goods receipt is posted, and splits one item into pallets or cartons with a separate label for each package. Scanning the barcode with a handheld makes later transfers, counts and issues to production error-free.
- Estimated effort
- M · 4–7 working days
- System
- ECC and S/4HANA
- Tables
- 8
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
The standard goods receipt output (the GR slip messages in MIGO and MB90) produces the goods receipt slip and a simple label form; it does not split an item into packages, calculate the quantity per package or create barcodes in the command language of thermal label printers. The barcode content cannot be set to the structure the company uses (e.g. GS1-128) either. The custom program determines label count, barcode content and printer according to the company's rules.
Who uses it? Goods receipt and warehouse teams, quality control and production logistics.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| MKPFMaterial Document Header | Material document header: posting date and delivery note number | Read | ECC + S/4 |
| MSEGMaterial Document Item | Goods receipt items: material, batch, quantity, vendor, order | Read | ECC + S/4 |
| MAKTMaterial Descriptions | Material description | Read | ECC + S/4 |
| MARAGeneral Material Data | EAN code and gross weight | Read | ECC + S/4 |
| MARMUnits of Measure for Material | Pallet and carton conversion factors (quantity per package) | Read | ECC + S/4 |
| MCHABatches (Plant Level) | Production and expiry date of the batch | Read | ECC + S/4 |
| LFA1Vendor Master (General Section) | Vendor name | Read | ECC + S/4 |
| NASTMessage Status | Output (message) record: print status and reprint check | Read / write | ECC + S/4 |
S/4HANA notes
- MKPF → MATDOC: In S/4HANA new material documents are written to MATDOC; reading MKPF works through a compatibility view. Use MATDOC or I_MaterialDocumentItem_2 directly in new reports.
- MSEG → MATDOC: In S/4HANA MATDOC replaces MSEG; reading MSEG works through a compatibility view but is slow at high volumes.
BAPIs and functions used
- SSF_FUNCTION_MODULE_NAMEGet Smart Form Function Module Name. Finds the generated function name of the label form
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_MBLNR | Material document | Single value | MKPF-MBLNR | Yes | 5000084512 |
| P_MJAHR | Material document year | Single value | MKPF-MJAHR | Yes | 2026 |
| S_ZEILE | Document item | Range / multiple | MSEG-ZEILE | No | 1–3 |
| P_PKQTY | Quantity per package (from MARM if empty) | Single value | — | No | 400 |
| P_PRNT | Label printer (output device) | Single value | — | No | ETK1 |
| P_REPRT | Reprint labels already printed (copy) | Checkbox | — | No | — |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Material document | MSEG-MBLNR |
| 2 | Item | MSEG-ZEILE |
| 3 | Material | MSEG-MATNR |
| 4 | Batch | MSEG-CHARG |
| 5 | Item quantity | MSEG-MENGE |
| 6 | Number of packages | Calculated Round up(item quantity / quantity per package) |
| 7 | Quantity per package | Calculated P_PKQTY or MARM conversion |
| 8 | Barcode | Calculated (01) EAN + (10) batch + (30) quantity |
| 9 | Status | Calculated Printed, copy printed or error |
Sample result list
| Material document | Item | Material | Batch | Item quantity | Number of packages | Quantity per package | Barcode | Status |
|---|---|---|---|---|---|---|---|---|
| 5000084512 | 1 | HM-1001 | L2611-07 | 1,200 | 3 | 400 | (01)08690000010019(10)L2611-07(30)400 | Printed |
| 5000084512 | 2 | HM-1002 | L2611-08 | 950 | 2 | 500 | (01)08690000010026(10)L2611-08(30)500 | Printed (last package 450) |
| 5000084530 | 1 | SP-0045 | 500 | 1 | 500 | (01)08690000000454(30)500 | Error: printer ETK1 not reachable |
How does the program work?
- The program runs automatically through an output condition at goods receipt, or manually from the selection screen with the material document number.
- Goods receipt items are read from MKPF/MSEG: material, batch, quantity, unit of measure, storage location, vendor and purchase order. The material description comes from MAKT, the EAN from MARA, and the batch production and expiry dates from MCHA.
- Number of packages: the user enters the quantity per package, or it is calculated from the pallet or carton conversion in MARM; the last package carries the remaining quantity.
- The barcode content combines EAN, batch and quantity (e.g. with GS1-128 application identifiers) and every package gets a sequence number.
- The label is produced with a Smart Form or Adobe Form, or directly in printer commands for thermal printers, and is sent to the default printer of the user or the storage location.
- Printed labels are tracked through the output record (NAST); when the same document is printed again the user is warned and the label is marked as “copy”.
Performance notes
Reading one material document is a key access and fast. For mass reprints, select documents by posting date and plant; collect the commands for the thermal printer in one spool request per document instead of one per package.
Features
- Test mode (check without posting) Labels are previewed without printing.
- Line-by-line result and error log
- Runs as a background job Printed automatically with the goods receipt through an output condition.
Authorization objects
- M_MSEG_WMBMaterial document display authorization by plant
- S_SPO_DEVAuthorization to print on the label printer (output device)
Frequently asked questions
Does it work with thermal label printers?
Yes. The label can be created in the printer's own command language and sent as a raw spool request; this gives the fastest and sharpest barcode. The same design can also be printed on a laser printer with a Smart Form or Adobe Form.
Can the barcode structure be changed?
Yes. The barcode content (EAN, batch, quantity, expiry date, order) and its order are kept in a settings table. Since the handheld screens decode the same structure, both sides are updated together.
Does it work on S/4HANA?
Yes. MKPF and MSEG are read as compatibility views in S/4HANA. The output can be triggered by classic message control or by S/4HANA output management; the label design does not change.
Related reports
Batch Shelf Life Tracking Report (Batches Close to Expiry)
A custom ALV report that lists batches close to or past their expiry date with remaining days, remaining shelf life percentage and stock value. Food, …
Purchase Order Goods Receipt Upload from File Program
A custom interface program that posts order, item, quantity, storage location, batch and delivery note rows from a warehouse system, a supplier …
Automatic Putaway Transfer Order Creation Job for Goods Receipt Interim Storage
A custom background job that finds open transfer requirements waiting in goods receipt interim storage longer than a set time, converts them into …
Let us build this program for your system
Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.