Subcontracting Dispatch, Dispatch Order Printout and Stock at Subcontractor Tracking Program
Short answer: A custom program that proposes the components of subcontracting purchase orders, posts the transfer to the subcontractor (541) in bulk, prints a dispatch order for each shipment and tracks, per subcontractor and document, the quantity sent, consumed and still at the subcontractor together with the finished quantity received back. The subcontracting process is run from one screen and period-end reconciliation with the subcontractor becomes easier.
- Estimated effort
- L · 10–15 working days
- System
- ECC and S/4HANA
- Tables
- 9
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
ME2O monitors subcontracting components and can start the 541 transfer, but it does not send the components of several orders in one step with batch selection or print a dispatch order in the company layout; in MIGO every shipment is entered by hand. MBLB shows the stock at the subcontractor but does not show which shipment belongs to which order or the finished goods received back in the same list. The custom program combines dispatch, printout and tracking.
Who uses it? Subcontracting coordinators, purchasing, warehouse and production planning teams.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| EKPOPurchasing Document Item | Open subcontracting order items (item category 3) | Read | ECC + S/4 |
| RESBReservation/Dependent Requirements | Component requirements of the subcontracting order | Read | ECC + S/4 |
| MSLBSpecial Stocks with Vendor | Component stock at the subcontractor | Read | ECC + S/4 |
| MCHBBatch Stocks | Unrestricted stock of the batches to send | Read | ECC + S/4 |
| MKPFMaterial Document Header | Dispatch material document header (written via BAPI) | Write | ECC only |
| MSEGMaterial Document Item | 541 dispatch items; 542 and 543 movements for tracking | Read / write | ECC only |
| MATDOCMaterial Documents (S/4HANA) | In S/4HANA the dispatch document is written to this table | Read / write | S/4HANA only |
| EKBEPurchasing Document History | Finished quantity received on the subcontracting order | Read | ECC + S/4 |
| LFA1Vendor Master (General Section) | Subcontractor name and address (dispatch order) | Read | ECC + S/4 |
S/4HANA notes
- MSLB → MATDOC: In S/4HANA special stock at vendor is no longer persisted in MSLB; it is calculated from MATDOC and the name MSLB is read through the compatibility view NSDM_V_MSLB. Reading code keeps working, but the table must not be written directly.
- MCHB → MATDOC: In S/4HANA batch stock quantities are calculated from MATDOC through a compatibility view; reads work, but test performance on large selections.
- 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
- BAPI_GOODSMVT_CREATEPost Goods Movement. Transfers the components to the subcontractor with movement 541
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Commits the dispatch document
- SSF_FUNCTION_MODULE_NAMEGet Smart Form Function Module Name. Finds the generated function name of the dispatch order form
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_LIFNR | Subcontractor | Range / multiple | EKKO-LIFNR | Yes | 100812 |
| S_WERKS | Plant | Range / multiple | EKPO-WERKS | Yes | 1000 |
| S_EBELN | Subcontracting order | Range / multiple | EKPO-EBELN | No | 4500021501 |
| S_EINDT | Delivery date | Range / multiple | EKET-EINDT | No | 16.11.2026 – 30.11.2026 |
| P_MSLB | Deduct stock at subcontractor from the proposal | Checkbox | — | No | X |
| P_TEST | Test mode (check without posting) | Checkbox | — | No | X |
| R_TRACK | Tracking view | Radio button | — | No | — |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Subcontractor | MSLB-LIFNR |
| 2 | Order | EKPO-EBELN |
| 3 | Item | EKPO-EBELP |
| 4 | Finished material | EKPO-MATNR |
| 5 | Component | RESB-MATNR |
| 6 | Batch | MSEG-CHARG |
| 7 | Sent (541) | Calculated Σ 541 − Σ 542 quantity |
| 8 | Consumed (543) | Calculated Σ 543 quantity |
| 9 | Stock at subcontractor | MSLB-LBLAB |
| 10 | Finished received | Calculated Σ EKBE goods receipt quantity |
| 11 | Material document | MSEG-MBLNR |
| 12 | Status | Calculated Sent, closed or error |
Sample result list
| Subcontractor | Order | Item | Finished material | Component | Batch | Sent (541) | Consumed (543) | Stock at subcontractor | Finished received | Material document | Status |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 100812 | 4500021501 | 10 | BR-2100 | SC-3300 | L2610-22 | 1,200 | 780 | 420 | 760 | 4900031240 | Sent, dispatch order printed |
| 100812 | 4500021501 | 20 | BR-2150 | SC-3310 | 500 | 0 | 500 | 0 | 4900031240 | Sent | |
| 100905 | 4500021533 | 10 | BY-0710 | HM-1001 | L2611-03 | 300 | 300 | 0 | 295 | Closed | |
| 100905 | 4500021540 | 10 | BY-0720 | HM-1001 | 0 | 0 | 0 | 0 | Error: insufficient unrestricted stock (180 KG) |
How does the program work?
- Selection: open subcontracting order items (EKPO-PSTYP = 3) are read by subcontractor, plant and delivery date; the component requirements of each item come from RESB via order number and item.
- Proposed quantity to send = component requirement − quantity already sent; optionally the stock already at the subcontractor (MSLB) is deducted. The user corrects quantity and batch in the ALV; batches are proposed from unrestricted stock in MCHB.
- Posting: the selected lines are posted per subcontractor in one material document with the order-referenced 541 movement via BAPI_GOODSMVT_CREATE.
- A dispatch order form is printed for the resulting material document: subcontractor address, order, components, batches, quantities and packaging. Optionally the document is emailed as a PDF to the subcontractor.
- Tracking view: per subcontractor and material the quantity sent (541), consumed (543) and returned (542) with the current stock in MSLB; per order the finished quantity received (EKBE) and the open finished quantity.
Performance notes
Read RESB only for the selected order items via order number and item. In the tracking view, aggregate the 541/542/543 movements from MSEG once by subcontractor and date range; in S/4HANA this aggregation runs in the database on MATDOC.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- ALV list (sort, filter, subtotals) The dispatch proposal and tracking view are edited in an ALV.
- Send the result by email The dispatch order can be emailed to the subcontractor as a PDF.
- Export to Excel
Authorization objects
- M_MSEG_BWAAuthorization for movement type 541
- M_MSEG_WMBGoods movement authorization by plant
- M_BEST_WRKOrder display authorization by plant
Frequently asked questions
Does the dispatch order replace the legal delivery note?
The dispatch order is an internal document showing which order the goods were sent for. If a legal delivery note or e-delivery note is required, the dispatch material document is passed to the existing delivery note integration; the program can be extended to trigger that step.
Can the stock at the subcontractor be tracked by batch?
Yes. MSLB keeps the stock at the subcontractor per batch; the tracking view shows sent and consumed quantities by batch. This makes it easier to trace which finished goods a batch-managed raw material went into.
Does it work on S/4HANA?
Yes. MSLB and MSEG are read as compatibility views in S/4HANA, the dispatch document is written to MATDOC and BAPI_GOODSMVT_CREATE is used the same way.
Related reports
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 …
Open Purchase Orders by Vendor Report
A custom ALV report that shows, per vendor, the quantity not yet received, the open order value and the days of delay since the delivery date in a …
Subcontracting Component Consumption and Stock at Vendor Reconciliation Report
A custom ALV report that compares the planned consumption of components sent to the vendor on subcontracting orders with the consumption posted at …
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.