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
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| MSEGMaterial Document Item | Material document items linked to barcodes (ECC) | Read | ECC only |
| MATDOCMaterial Documents (S/4HANA) | Material documents linked to barcodes (S/4HANA) | Read | S/4HANA only |
| MARDStorage Location Data for Material | Storage location stock (reconciliation) | Read | ECC + S/4 |
| MCHBBatch Stocks | Batch stock (reconciliation) | Read | ECC + S/4 |
| MSPRProject Stock | Project stock (reconciliation of WBS-assigned barcodes) | Read | ECC + S/4 |
| PRPSWBS Element Master Data | WBS element validity and description | Read | ECC + S/4 |
| MARAGeneral Material Data | Material and batch management flag | Read | ECC + S/4 |
| MAKTMaterial Descriptions | Material description on label and report | Read | ECC + 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
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_BARCODE | Barcode | Range / multiple | — | No | — |
| S_MATNR | Material | Range / multiple | MARD-MATNR | No | KB-11030 |
| S_WERKS | Plant | Range / multiple | MARD-WERKS | Yes | 1000 |
| 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 |
|---|---|---|
| 1 | Barcode | Calculated Custom barcode number |
| 2 | Parent barcode | Calculated Source barcode if split |
| 3 | Material | MARA-MATNR |
| 4 | Description | MAKT-MAKTX |
| 5 | Batch | MCHB-CHARG |
| 6 | Storage location | MARD-LGORT |
| 7 | Quantity | Calculated Current quantity of the barcode |
| 8 | WBS element | PRPS-POSID |
| 9 | Last document | MSEG-MBLNR |
| 10 | Status | Calculated In stock, in project, consumed, split |
Sample result list
| Barcode | Parent barcode | Material | Description | Batch | Storage location | Quantity | WBS element | Last document | Status |
|---|---|---|---|---|---|---|---|---|---|
| BC26110004512 | KB-11030 | Cable NYY 3x2.5 | B2611-02 | 0001 | 60 M | 5000123401 | In stock | ||
| BC26110004587 | BC26110004512 | KB-11030 | Cable NYY 3x2.5 | B2611-02 | 0001 | 40 M | P-26-0012.03 | 4900120880 | In project |
| BC26110004601 | EL-88015 | Panel door 600x800 | 0005 | 1 PC | 4900120902 | Consumed |
How does the program work?
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
Goods Receipt Barcode Batch and Package Label Printing Program
A custom output program that automatically prints a barcode label with material, batch, quantity, vendor, purchase order and receipt date for each …
Handheld (RF) Screens for Goods Receipt, Storage Location Transfer and Shipment
Custom mobile screens sized for barcode handhelds that let warehouse staff post goods receipts against purchase orders, transfers between storage …
Project Stock Left on Technically Completed or Closed WBS Elements Report
A custom ALV report that lists project stock (special stock Q) still sitting on technically completed (TECO) or closed (CLSD) WBS elements with …
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.