MM Program Custom development Fiori app

Barcode-Level Stock Tracking: Split, Project Assignment and Barcode Report

Short answer: A program that tracks every carton or piece with its own barcode in warehouses that do not use handling unit management. A barcode is created at goods receipt, can be split and assigned to a project (WBS), and the location, quantity and movement history of every barcode are reported; barcode movements stay in step with standard stock.

Estimated effort
L · 15–22 working days
System
ECC and S/4HANA
Tables
8
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

Why is the standard not enough?

Standard inventory management (IM) keeps stock at material, storage location and batch level; it does not tell apart ten cartons of the same batch. Carton-level tracking needs handling unit management (HU) or EWM, which means a large change to warehouse processes. Serial numbers are meant for single pieces and cannot be used for cartons with quantities. As a result many warehouses keep barcodes in Excel and drift away from SAP stock.

Who uses it? Warehouse staff, project warehouses, inventory control teams and manufacturing and construction companies that need traceability.

Closest standard alternatives

  • MMBE Stock Overview. Shows stock by material, storage location and batch; no carton or barcode breakdown.
  • MB52 List of Warehouse Stocks on Hand. Lists warehouse stock; no barcode level.
  • MIGO Goods Movement. Posts goods movements; does not create or track barcodes.

Tables used

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

TableRoleAccessSystem
MSEGMaterial Document ItemMaterial document items linked to barcodes (ECC)ReadECC only
MATDOCMaterial Documents (S/4HANA)Material documents linked to barcodes (S/4HANA)ReadS/4HANA only
MARDStorage Location Data for MaterialStorage location stock (reconciliation)ReadECC + S/4
MCHBBatch StocksBatch stock (reconciliation)ReadECC + S/4
MSPRProject StockProject stock (reconciliation of WBS-assigned barcodes)ReadECC + S/4
PRPSWBS Element Master DataWBS element validity and descriptionReadECC + S/4
MARAGeneral Material DataMaterial and batch management flagReadECC + S/4
MAKTMaterial DescriptionsMaterial description on label and reportReadECC + S/4

S/4HANA notes

  • MSEG → MATDOC: In S/4HANA MATDOC replaces MSEG; reading MSEG works through a compatibility view but is slow at high volumes.
  • MARD → MATDOC: In S/4HANA stock quantities are no longer stored physically; reading MARD returns values calculated on the fly from MATDOC through a compatibility view. Reads still work, but test performance on very large selections.
  • MCHB → MATDOC: In S/4HANA batch stock quantities are calculated from MATDOC through a compatibility view; reads work, but test performance on large selections.
  • MSPR → MATDOC: In S/4HANA stock quantities are derived from MATDOC; reads on MSPR are served through the compatibility view NSDM_V_MSPR.

BAPIs and functions used

  • BAPI_GOODSMVT_CREATEPost Goods Movement. Posts transfers, issues and project assignments made by scanning a barcode
  • BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves the goods movement together with the barcode update
  • SSF_FUNCTION_MODULE_NAMEGet Smart Form Function Module Name. Calls the barcode label form

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_BARCODEBarcodeRange / multiple—No—
S_MATNRMaterialRange / multipleMARD-MATNRNoKB-11030
S_WERKSPlantRange / multipleMARD-WERKSYes1000
S_LGORTStorage locationRange / multipleMARD-LGORTNo—
S_PSPNRWBS elementRange / multiplePRPS-POSIDNo—
P_DIFFOnly differences to standard stockCheckbox—No—

Result list columns

#ColumnSource
1BarcodeCalculated Custom barcode number
2Parent barcodeCalculated Source barcode if split
3MaterialMARA-MATNR
4DescriptionMAKT-MAKTX
5BatchMCHB-CHARG
6Storage locationMARD-LGORT
7QuantityCalculated Current quantity of the barcode
8WBS elementPRPS-POSID
9Last documentMSEG-MBLNR
10StatusCalculated In stock, in project, consumed, split

Sample result list

BarcodeParent barcodeMaterialDescriptionBatchStorage locationQuantityWBS elementLast documentStatus
BC26110004512KB-11030Cable NYY 3x2.5B2611-02000160 M5000123401In stock
BC26110004587BC26110004512KB-11030Cable NYY 3x2.5B2611-02000140 MP-26-0012.034900120880In project
BC26110004601EL-88015Panel door 600x80000051 PC4900120902Consumed
A view built with fictional sample data; not real system data.

How does the program work?

  1. At goods receipt (MIGO or handheld terminal) a unique barcode is generated per carton and written to a custom barcode table with material, batch, plant, storage location, quantity, unit, material document and status; the label is printed with Smart Forms.
  2. Barcode split: part of a barcode’s quantity is moved to a new barcode (for example a 100 m roll into 60 + 40). The parent barcode’s quantity goes down, the new barcode is created with the same material, batch and location, and the link is kept; standard stock does not change, only the barcode breakdown does.
  3. Storage location transfers and issues to consumption done by scanning a barcode are posted as standard goods movements with BAPI_GOODSMVT_CREATE, and the barcode’s location or status is updated in the same step; the material document is added to the barcode history.
  4. Project assignment: when a barcode is scanned and a WBS element selected, a transfer from unrestricted stock to project stock (movement type 415 Q) is posted; the barcode is flagged as project stock and matches the project stock in MSPR.
  5. A reconciliation job compares barcode totals with standard stock (MARD, MCHB, MSPR) by material, batch and storage location and lists the differences; movements made outside the program become visible this way.
  6. The barcode report shows the current location, quantity, project assignment and movement history of every barcode. In S/4HANA goods movements are written to MATDOC; because the program only uses the BAPI, it does not change. If the warehouse moves to EWM later, barcodes can be converted into handling units.

Performance notes

Define a secondary index on material + plant + storage location + batch in the barcode table; the reconciliation job aggregates by this key. On the scanning screen read only the scanned barcode's row and post the goods movement in the same LUW as the barcode update.

Features

  • ALV list (sort, filter, subtotals)
  • Double-click drill-down to the document
  • Line-by-line result and error log
  • Runs as a background job Reconciliation of barcodes and standard stock runs as a nightly job.

Authorization objects

  • M_MSEG_BWAMovement type authorization for barcode movements
  • M_MSEG_WWAGoods movement authorization by plant
  • M_MSEG_LGOGoods movement authorization by storage location

Frequently asked questions

Why this solution instead of handling unit management (HU)?

HU management requires the storage location to become HU-managed and changes delivery and packing processes. This program adds a barcode breakdown without changing existing IM processes; barcode data can be carried over if you later move to HU or EWM.

What if someone posts a movement in MIGO without a barcode?

Standard stock changes but the barcode table does not. The nightly reconciliation lists the difference by material, batch and storage location, and the warehouse team corrects the barcodes. If preferred, movements without a barcode can be blocked for selected storage locations during installation.

Does splitting a barcode change stock?

No. A split only changes the barcode breakdown; the total stays the same and no goods movement is posted. A new label is printed for the split barcode.

Related reports

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: Barcode-Level Stock Tracking: Split, Project Assignment and Barcode Report