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

> 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.

- Type: Program, Custom development, Fiori app
- Module: MM
- Estimated effort: L (15–22 working days)
- Last updated: 2026-11-18
- URL: https://nekuhub.com/en/programs/barcode-level-stock-tracking-split-and-project-assignment/


## 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.

### Closest standard alternatives

- MMBE: Shows stock by material, storage location and batch; no carton or barcode breakdown.
- MB52: Lists warehouse stock; no barcode level.
- MIGO: Posts goods movements; does not create or track barcodes.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| MSEG | Material document items linked to barcodes (ECC) | Read | - | ECC only |
| MATDOC | Material documents linked to barcodes (S/4HANA) | Read | - | S/4HANA only |
| MARD | Storage location stock (reconciliation) | Read | - | ECC + S/4 |
| MCHB | Batch stock (reconciliation) | Read | - | ECC + S/4 |
| MSPR | Project stock (reconciliation of WBS-assigned barcodes) | Read | - | ECC + S/4 |
| PRPS | WBS element validity and description | Read | - | ECC + S/4 |
| MARA | Material and batch management flag | Read | - | ECC + S/4 |
| MAKT | Material description on label and report | Read | MAKT-MATNR = MARA-MATNR | ECC + S/4 |

## BAPIs and functions used

- BAPI_GOODSMVT_CREATE: Posts transfers, issues and project assignments made by scanning a barcode
- BAPI_TRANSACTION_COMMIT: Saves the goods movement together with the barcode update
- SSF_FUNCTION_MODULE_NAME: Calls the barcode label form

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_BARCODE | Barcode | Range / multiple | - | No |
| S_MATNR | Material | Range / multiple | MARD-MATNR | No |
| S_WERKS | Plant | Range / multiple | MARD-WERKS | Yes |
| S_LGORT | Storage location | Range / multiple | MARD-LGORT | No |
| S_PSPNR | WBS element | Range / multiple | PRPS-POSID | No |
| P_DIFF | Only differences to standard stock | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Barcode | Calculated: Custom barcode number |
| Parent barcode | Calculated: Source barcode if split |
| Material | MARA-MATNR |
| Description | MAKT-MAKTX |
| Batch | MCHB-CHARG |
| Storage location | MARD-LGORT |
| Quantity | Calculated: Current quantity of the barcode |
| WBS element | PRPS-POSID |
| Last document | MSEG-MBLNR |
| Status | Calculated: In stock, in project, consumed, split |

## 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.

## Authorization objects

- M_MSEG_BWA: Movement type authorization for barcode movements
- M_MSEG_WWA: Goods movement authorization by plant
- M_MSEG_LGO: Goods 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.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=mm-barcode-unit-tracking
