MM Program Custom development Form

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

  • MB90 Output Processing for Material Documents. Processes output for material documents in bulk; no split into packages and no thermal printer barcode.
  • MIGO Goods Movement. Prints the goods receipt slip and the standard label; does not create one label per package.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
MKPFMaterial Document HeaderMaterial document header: posting date and delivery note numberReadECC + S/4
MSEGMaterial Document ItemGoods receipt items: material, batch, quantity, vendor, orderReadECC + S/4
MAKTMaterial DescriptionsMaterial descriptionReadECC + S/4
MARAGeneral Material DataEAN code and gross weightReadECC + S/4
MARMUnits of Measure for MaterialPallet and carton conversion factors (quantity per package)ReadECC + S/4
MCHABatches (Plant Level)Production and expiry date of the batchReadECC + S/4
LFA1Vendor Master (General Section)Vendor nameReadECC + S/4
NASTMessage StatusOutput (message) record: print status and reprint checkRead / writeECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_MBLNRMaterial documentSingle valueMKPF-MBLNRYes5000084512
P_MJAHRMaterial document yearSingle valueMKPF-MJAHRYes2026
S_ZEILEDocument itemRange / multipleMSEG-ZEILENo1–3
P_PKQTYQuantity per package (from MARM if empty)Single value—No400
P_PRNTLabel printer (output device)Single value—NoETK1
P_REPRTReprint labels already printed (copy)Checkbox—No—

Result list columns

#ColumnSource
1Material documentMSEG-MBLNR
2ItemMSEG-ZEILE
3MaterialMSEG-MATNR
4BatchMSEG-CHARG
5Item quantityMSEG-MENGE
6Number of packagesCalculated Round up(item quantity / quantity per package)
7Quantity per packageCalculated P_PKQTY or MARM conversion
8BarcodeCalculated (01) EAN + (10) batch + (30) quantity
9StatusCalculated Printed, copy printed or error

Sample result list

Material documentItemMaterialBatchItem quantityNumber of packagesQuantity per packageBarcodeStatus
50000845121HM-1001L2611-071,2003400(01)08690000010019(10)L2611-07(30)400Printed
50000845122HM-1002L2611-089502500(01)08690000010026(10)L2611-08(30)500Printed (last package 450)
50000845301SP-00455001500(01)08690000000454(30)500Error: printer ETK1 not reachable
A view built with fictional sample data; not real system data.

How does the program work?

  1. The program runs automatically through an output condition at goods receipt, or manually from the selection screen with the material document number.
  2. 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.
  3. 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.
  4. The barcode content combines EAN, batch and quantity (e.g. with GS1-128 application identifiers) and every package gets a sequence number.
  5. 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.
  6. 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

MM Report Custom ALV report ChemicalsFood and Beverage

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, …

MCHB · MCHA · MARA · MAKT

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.

Related report: Goods Receipt Barcode Batch and Package Label Printing Program