Purchase Order Goods Receipt Upload from File Program
Short answer: A custom interface program that posts order, item, quantity, storage location, batch and delivery note rows from a warehouse system, a supplier delivery note file or Excel as goods receipts (101) for purchase orders in bulk. It never posts the same delivery note twice, checks in test mode first and lists the material document number of every row.
- Estimated effort
- M · 4–6 working days
- System
- ECC and S/4HANA
- Tables
- 4
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
MIGO posts each goods receipt on screen one at a time; MB01 in ECC also works one document at a time. There is no standard transaction that reads confirmed receipt rows from a file sent by an external warehouse system or handheld terminal, checks them against the open order quantity, prevents duplicate postings and runs as a nightly job. Busy warehouses therefore spend hours on manual MIGO entry.
Who uses it? Warehouse and goods receiving teams, MM and integration teams of companies that use an external warehouse system.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| MKPFMaterial Document Header | Material document header: posting date, delivery note; also read for the duplicate check | Write | ECC + S/4 |
| MSEGMaterial Document Item | Material document item: order reference, quantity, storage location, batch | Write | ECC + S/4 |
| EKBEPurchasing Document History | Order history: earlier receipts (open quantity) and the new receipt entry | Write | ECC + S/4 |
| EKPOPurchasing Document Item | Order item: quantity, tolerance, deletion and delivery completed flags | Read | ECC + 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
- BAPI_GOODSMVT_CREATEPost Goods Movement. Posts the goods receipt for the order (101) as one document per delivery note
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful goods receipts permanently
- BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back changes in test mode or on error
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | File or server folder | Single value | — | Yes | /interface/mm/goods_receipt/ |
| P_SERVER | Read from application server | Checkbox | — | No | X |
| P_BWART | Movement type | Single value | MSEG-BWART | No | 101 |
| P_TEST | Test mode (check without posting) | Checkbox | — | No | X |
| P_SKIPD | Skip delivery notes already posted | Checkbox | — | No | X |
Input file columns
The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.
| # | Column | Target field | Required |
|---|---|---|---|
| 1 | Purchase order | MSEG-EBELN | Yes |
| 2 | Item | MSEG-EBELP | Yes |
| 3 | Quantity | MSEG-ERFMG | Yes |
| 4 | Unit | MSEG-ERFME | No |
| 5 | Storage location | MSEG-LGORT | No |
| 6 | Batch | MSEG-CHARG | No |
| 7 | Posting date | MKPF-BUDAT | Yes |
| 8 | Document date | MKPF-BLDAT | No |
| 9 | Delivery note | MKPF-XBLNR | Yes |
| 10 | Header text | MKPF-BKTXT | No |
Sample upload file
| 1 | Purchase order * | Item * | Quantity * | Unit | Storage location | Batch | Posting date * | Document date | Delivery note * | Header text |
|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 4500013140 | 00020 | 600 | KG | 1000 | 11/16/2026 | 11/15/2026 | DLT-IRS-88412 | Partial delivery | |
| 3 | 4500013102 | 00010 | 3,000 | PC | 1000 | B2611-07 | 11/16/2026 | 11/16/2026 | ATL-55890 | |
| 4 | 4500013177 | 00010 | 500 | KG | 2000 | 11/16/2026 | 11/14/2026 | EGK-IRS-1207 |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | Purchase order | MSEG-EBELN |
| 3 | Item | MSEG-EBELP |
| 4 | Material | MSEG-MATNR |
| 5 | Quantity | MSEG-ERFMG |
| 6 | Delivery note | MKPF-XBLNR |
| 7 | Material document | MKPF-MBLNR |
| 8 | Document year | MKPF-MJAHR |
| 9 | Status | Calculated Posted, skipped (duplicate) or error |
| 10 | Message | Calculated First error or success message from the BAPI return table |
Sample result list
| Row | Purchase order | Item | Material | Quantity | Delivery note | Material document | Document year | Status | Message |
|---|---|---|---|---|---|---|---|---|---|
| 2 | 4500013140 | 00020 | RM-2040 | 600 | DLT-IRS-88412 | 5000412870 | 2026 | Posted | Material document created |
| 3 | 4500013102 | 00010 | PK-1180 | 3,000 | ATL-55890 | 5000412871 | 2026 | Posted | Material document created |
| 4 | 4500013177 | 00010 | CH-0315 | 500 | EGK-IRS-1207 | Error | Open quantity 400 KG; over-delivery tolerance exceeded |
How does the program work?
- The file is read from the user’s PC or, in a background job, from a folder on the application server; each row carries order, item, quantity, unit, storage location, batch, posting date, document date, delivery note number and header text.
- Checks: the EKPO item must exist, must not be deleted (LOEKZ) or delivery-completed (ELIKZ); open quantity = EKPO-MENGE − Σ EKBE goods receipts (VGABE = 1); the quantity must not exceed the over-delivery tolerance; batch-managed materials need a batch.
- Duplicate check: if a non-reversed (MSEG-SMBLN) 101 movement already exists for the same delivery note (MKPF-XBLNR), order and item, the row is skipped.
- Rows are grouped by delivery note, and for each delivery note BAPI_GOODSMVT_CREATE is called with movement code 01, movement type 101 and the order reference; in test mode it runs with the BAPI test flag and BAPI_TRANSACTION_ROLLBACK follows.
- In a real run BAPI_TRANSACTION_COMMIT is done per delivery note; the material document and year (MBLNR, MJAHR) are written to the result list. The processed file is moved to an archive folder and failed rows are written to a separate file.
Performance notes
Because all items of a delivery note are posted in one material document, daily files of a few thousand rows are processed in minutes. If the same order is locked by another user, the row fails and is retried in the next run.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Download failed lines as a separate file Failed rows can be corrected and uploaded again with the same template.
- Runs as a background job Files dropped by the warehouse system are processed automatically by an hourly or nightly job.
Authorization objects
- M_MSEG_BWAGoods movement authorization by movement type
- M_MSEG_WWAGoods movement authorization by plant
Frequently asked questions
Can receipts be posted to quality inspection or blocked stock?
Yes. By adding a stock type column to the file, the receipt can be directed to unrestricted, quality inspection or blocked stock; for materials with active inspection the stock type comes from the material setting.
Can the delivery completed flag be set from the file?
Yes. With an optional column, rows marked as final delivery send the delivery completed indicator to the BAPI and the order item is closed.
Does the program work on S/4HANA?
Yes. BAPI_GOODSMVT_CREATE is also supported on S/4HANA and writes the document to MATDOC; the MKPF and MSEG reads work through compatibility views.
Related reports
Goods Received Not Invoiced Purchase Orders Report (GR/IR)
A custom ALV report that compares received and invoiced quantity and amount per purchase order item and lists items that were received but not …
Mass Purchase Order Creation from Excel Program
A custom program that creates purchase orders in bulk from Excel or CSV rows, grouping them by vendor, purchasing organization and group number. It …
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.