MM Program Custom development Interface

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

  • MIGO Goods Movement. Posts a goods receipt on screen as one document; does not read a file and does not prevent duplicates.
  • MB01 Post Goods Receipt for PO. Posts goods receipts for orders one at a time in ECC; replaced by MIGO in S/4HANA.

Tables used

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

TableRoleAccessSystem
MKPFMaterial Document HeaderMaterial document header: posting date, delivery note; also read for the duplicate checkWriteECC + S/4
MSEGMaterial Document ItemMaterial document item: order reference, quantity, storage location, batchWriteECC + S/4
EKBEPurchasing Document HistoryOrder history: earlier receipts (open quantity) and the new receipt entryWriteECC + S/4
EKPOPurchasing Document ItemOrder item: quantity, tolerance, deletion and delivery completed flagsReadECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_FILEFile or server folderSingle value—Yes/interface/mm/goods_receipt/
P_SERVERRead from application serverCheckbox—NoX
P_BWARTMovement typeSingle valueMSEG-BWARTNo101
P_TESTTest mode (check without posting)Checkbox—NoX
P_SKIPDSkip delivery notes already postedCheckbox—NoX

Input file columns

The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.

#ColumnTarget fieldRequired
1Purchase orderMSEG-EBELNYes
2ItemMSEG-EBELPYes
3QuantityMSEG-ERFMGYes
4UnitMSEG-ERFMENo
5Storage locationMSEG-LGORTNo
6BatchMSEG-CHARGNo
7Posting dateMKPF-BUDATYes
8Document dateMKPF-BLDATNo
9Delivery noteMKPF-XBLNRYes
10Header textMKPF-BKTXTNo

Sample upload file

1Purchase order *Item *Quantity *UnitStorage locationBatchPosting date *Document dateDelivery note *Header text
2450001314000020600KG100011/16/202611/15/2026DLT-IRS-88412Partial delivery
34500013102000103,000PC1000B2611-0711/16/202611/16/2026ATL-55890
4450001317700010500KG200011/16/202611/14/2026EGK-IRS-1207
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1RowCalculated Row number in the file
2Purchase orderMSEG-EBELN
3ItemMSEG-EBELP
4MaterialMSEG-MATNR
5QuantityMSEG-ERFMG
6Delivery noteMKPF-XBLNR
7Material documentMKPF-MBLNR
8Document yearMKPF-MJAHR
9StatusCalculated Posted, skipped (duplicate) or error
10MessageCalculated First error or success message from the BAPI return table

Sample result list

RowPurchase orderItemMaterialQuantityDelivery noteMaterial documentDocument yearStatusMessage
2450001314000020RM-2040600DLT-IRS-8841250004128702026PostedMaterial document created
3450001310200010PK-11803,000ATL-5589050004128712026PostedMaterial document created
4450001317700010CH-0315500EGK-IRS-1207ErrorOpen quantity 400 KG; over-delivery tolerance exceeded
A view built with fictional sample data; not real system data.

How does the program work?

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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

MM Program Custom Mass upload

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 …

EKKO · EKPO · EKET · EKKN

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: Purchase Order Goods Receipt Upload from File Program