Jump to a template (15)
- ME51NPurchase Requisition
- ME21NPurchase Order
- ME22NPurchase Order Change
- ME31KPurchase Contract
- ML81NService Entry Sheet
- MIGOGoods Receipt against Purchase Order
- MB1CGoods Receipt without Purchase Order
- MB1AGoods Issue
- MB1BStock Transfer Posting
- MB21Reservation
- MI01Physical Inventory Document
- MI04Physical Inventory Count Entry
- MI07Post Inventory Differences
- MIROSupplier Invoice, logistics
- MIR7Park Supplier Invoice
Loading order and dependencies
The purchasing chain loads in order and each step references the one before it. Purchase requisition, then purchase order, then goods receipt against the order item, then the supplier invoice against the goods receipt. Physical inventory runs as its own three step sequence: create the document, enter the count, post the differences. The templates use matching sample data across the chain so you can see exactly which field links each step to the next.
Use this sequence whenever these files serve as SAP migration templates in an S/4HANA migration, and again for mass loads after go live.
Using these templates with the SAP Migration Cockpit or LSMW
Purchasing and inventory data load late in an SAP data migration, once master data exists. The column to field mapping in these workbooks is the same mapping the SAP Migration Cockpit and LSMW both need. Teams use them to stage open purchase orders and stock before an S/4HANA migration go live, then keep them for the mass change work on live documents afterwards.
SAP Purchase Requisition Upload Template (ME51N)
Raise purchase requisitions in bulk. An H row starts a requisition and the D rows under it are its items.
BAPI_PR_CREATEWatch DemoThe Enjoy generation requisition interface, which is the one behind ME51N. The older BAPI_REQUISITION_CREATE is structurally different and should not be used for anything current.
What to watchThe X structure trap on this BAPI is specific and catches almost everyone. In PRITEMX the field PREQ_ITEM is NUMC and holds the actual item number (00010), not a flag. PREQ_ITEMX and every other field in that structure are the flags. Put an X in PREQ_ITEM and the X row silently detaches from its data row, and the item comes back empty.
Mandatory fields 8 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Document Type | PRHEADER | PR_TYPE | NB standard. Almost the only header field that matters. |
| Item | PRITEM | PREQ_ITEM | 00010, 00020. Also goes into PRITEMX as the join key. |
| Short Text | PRITEM | SHORT_TEXT | Taken from the material master if Material is filled. |
| Quantity | PRITEM | QUANTITY | |
| Unit of Measure | PRITEM | UNIT | |
| Delivery Date | PRITEM | DELIV_DATE | YYYYMMDD. |
| Plant | PRITEM | PLANT | |
| Purchasing Group | PRITEM | PUR_GROUP |
SAP Purchase Order Upload Template (ME21N)
Raise purchase orders in bulk. An H row starts an order and the D rows under it are its items.
BAPI_PO_CREATE1Watch DemoThe Enjoy generation purchase order interface. Same business logic as ME21N, including release strategy.
What to watchA purchase order is three levels deep in SAP: header (EKKO), items (EKPO) and schedule lines (EKET). This flat template covers header and item, and the schedule line is derived from the delivery date. Every data structure needs its X partner flagged, or the field is ignored.
Mandatory fields 12 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Document Type | POHEADER | DOC_TYPE | NB standard. |
| Vendor | POHEADER | VENDOR | Must be extended to the purchasing org. |
| Purchasing Org | POHEADER | PURCH_ORG | |
| Purchasing Group | POHEADER | PUR_GROUP | |
| Company Code | POHEADER | COMP_CODE | |
| Currency | POHEADER | CURRENCY | |
| Item | POITEM | PO_ITEM | 00010, 00020. |
| Short Text | POITEM | SHORT_TEXT | Required when Material is blank. |
| Quantity | POITEM | QUANTITY | |
| Order Unit | POITEM | PO_UNIT | |
| Delivery Date | POSCHEDULE | DELIVERY_DATE | YYYYMMDD. |
| Plant | POITEM | PLANT |
SAP Purchase Order Change Upload Template (ME22N)
Change existing purchase orders in bulk. An H row identifies the order, D rows are the items being changed.
BAPI_PO_CHANGEWatch DemoThe change counterpart to BAPI_PO_CREATE1. The X structures do all the work here: they are what separates a field you are changing from one you are leaving alone.
What to watchThe X trap here is precise. In POITEMX the field PO_ITEM is NUMC 5 and must carry the real item number, while PO_ITEMX beside it is the flag. Put an X in PO_ITEM and the value is invalid, so the row is either ignored or applied to the wrong item. Omit the X rows entirely and the BAPI silently changes nothing at all.
Mandatory fields 2 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Purchase Order | PURCHASEORDER | PO_NUMBER | The order being changed. Must exist. |
| Item | POITEM | PO_ITEM | Also goes into POITEMX as NUMC, alongside the PO_ITEMX flag. |
SAP Purchase Contract Upload Template (ME31K)
Create purchase contracts. An H row is the contract header and the D rows under it are its items.
BAPI_CONTRACT_CREATEWatch DemoThe largest interface in this set, with 24 TABLES parameters. It follows the standard MM pattern of paired X structures throughout.
What to watchThe X pairing here has a twist. In ITEMX the field ITEM_NO keeps its real data element and holds the actual item number for row matching, and there is a SEPARATE ITEM_NOX flag beside it. So an item X row needs ITEM_NO set to the item number AND ITEM_NOX set to X, plus an X on every field you are sending.
Mandatory fields 11 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Document Type | HEADER | DOC_TYPE | MK quantity contract, WK value contract. |
| Vendor | HEADER | VENDOR | Must be extended to the purchasing org. |
| Purchasing Org | HEADER | PURCH_ORG | |
| Purchasing Group | HEADER | PUR_GROUP | |
| Company Code | HEADER | COMP_CODE | |
| Valid From | HEADER | VPER_START | YYYYMMDD. |
| Valid To | HEADER | VPER_END | YYYYMMDD. |
| Currency | HEADER | CURRENCY | |
| Item | ITEM | ITEM_NO | Also goes into ITEMX for row matching, alongside ITEM_NOX. |
| Short Text | ITEM | SHORT_TEXT | Required when Material is blank. |
| Order Unit | ITEM | PO_UNIT |
SAP Service Entry Sheet Upload Template (ML81N)
Record services performed against a service purchase order. An H row is the sheet, D rows are the service lines.
BAPI_ENTRYSHEET_CREATEWatch DemoOne of the few interfaces that commits internally by default. It also has the most demanding structural requirement in this set: a two level package hierarchy.
What to watchService lines need a two level package hierarchy, and getting it wrong is the usual failure. One outline row carries the outline indicator and points at a sub package number, and the actual service rows sit under that sub package. Flatten it into a simple list and nothing loads.
Mandatory fields 8 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Purchase Order | ENTRYSHEETHEADER | PO_NUMBER | The service purchase order. |
| PO Item | ENTRYSHEETHEADER | PO_ITEM | |
| Package Number | ENTRYSHEETHEADER | PCKG_NO | The outline package for this sheet. Must be unique across sheets. |
| Short Text | ENTRYSHEETHEADER | SHORT_TEXT | |
| Document Date | ENTRYSHEETHEADER | DOC_DATE | YYYYMMDD. |
| Posting Date | ENTRYSHEETHEADER | POST_DATE | YYYYMMDD. |
| Line Package | ENTRYSHEETSERVICES | PCKG_NO | The package this line belongs to. |
| Line Number | ENTRYSHEETSERVICES | LINE_NO | Sequential within the package. |
SAP Goods Receipt against Purchase Order Upload Template (MIGO)
Receive goods against purchase orders in bulk. An H row starts a material document and the D rows are its lines.
BAPI_GOODSMVT_CREATEWatch DemoThe single interface behind every goods movement. What changes between a receipt, an issue and a transfer is the movement type and the goods movement code.
What to watchGOODSMVT_CODE is a separate parameter, not a field on the header, and the BAPI does nothing useful without it. For a goods receipt against a purchase order it is 01. Getting it wrong produces errors that read like data problems and send people looking in the wrong place.
Mandatory fields 12 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Goods Movement Code | GOODSMVT_CODE | GM_CODE | 01 for a goods receipt against a purchase order. |
| Document Date | GOODSMVT_HEADER | DOC_DATE | YYYYMMDD. |
| Posting Date | GOODSMVT_HEADER | PSTNG_DATE | Period must be open. YYYYMMDD. |
| Line | GOODSMVT_ITEM | MATERIAL | Sequential line number for your own reference. |
| Movement Type | GOODSMVT_ITEM | MOVE_TYPE | 101 goods receipt, 102 reversal. |
| Purchase Order | GOODSMVT_ITEM | PO_NUMBER | Must exist and still have open quantity. |
| PO Item | GOODSMVT_ITEM | PO_ITEM | 00010, 00020. |
| Material | GOODSMVT_ITEM | MATERIAL | Must match the PO item. |
| Quantity | GOODSMVT_ITEM | ENTRY_QNT | |
| Unit of Entry | GOODSMVT_ITEM | ENTRY_UOM | |
| Plant | GOODSMVT_ITEM | PLANT | |
| Storage Location | GOODSMVT_ITEM | STGE_LOC |
SAP Initial Stock Entry Upload Template (MB1C)
Receive stock with no purchase order behind it: initial stock entry, free goods, found stock. An H row is the document, D rows are its lines.
BAPI_GOODSMVT_CREATEWatch DemoThe same interface as any goods movement. For an other goods receipt the goods movement code is 05.
What to watchMovement type 561 is initial stock entry and it posts against an offsetting account rather than a purchase order. That makes it the fastest way to put opening balances into a new plant, and also the fastest way to put wrong numbers into the ledger. Reconcile the value, not just the quantity.
Mandatory fields 9 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Goods Movement Code | GOODSMVT_CODE | GM_CODE | 05 for an other goods receipt. |
| Document Date | GOODSMVT_HEADER | DOC_DATE | YYYYMMDD. |
| Posting Date | GOODSMVT_HEADER | PSTNG_DATE | Period must be open. YYYYMMDD. |
| Movement Type | GOODSMVT_ITEM | MOVE_TYPE | 561 initial entry, 501 free goods. |
| Material | GOODSMVT_ITEM | MATERIAL | |
| Quantity | GOODSMVT_ITEM | ENTRY_QNT | |
| Unit of Entry | GOODSMVT_ITEM | ENTRY_UOM | |
| Plant | GOODSMVT_ITEM | PLANT | |
| Storage Location | GOODSMVT_ITEM | STGE_LOC |
SAP Goods Issue Upload Template (MB1A)
Issue stock to cost centers, orders or scrap. The movement type decides which assignment is required.
BAPI_GOODSMVT_CREATEWatch DemoThe same interface as any goods movement. For an issue the goods movement code is 03.
What to watchFor a goods issue the goods movement code is 03, and it is a separate parameter from the movement type. The movement type then decides which assignment field is mandatory: 201 needs a cost center, 261 needs an order, 551 needs a scrap reason and usually a cost center.
Mandatory fields 10 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Goods Movement Code | GOODSMVT_CODE | GM_CODE | 03 for a goods issue. |
| Document Date | GOODSMVT_HEADER | DOC_DATE | YYYYMMDD. |
| Posting Date | GOODSMVT_HEADER | PSTNG_DATE | YYYYMMDD. |
| Line | GOODSMVT_ITEM | MATERIAL | Sequential line number for your own reference. |
| Movement Type | GOODSMVT_ITEM | MOVE_TYPE | 201 to cost center, 261 to order, 551 scrap. |
| Material | GOODSMVT_ITEM | MATERIAL | |
| Quantity | GOODSMVT_ITEM | ENTRY_QNT | |
| Unit of Entry | GOODSMVT_ITEM | ENTRY_UOM | |
| Plant | GOODSMVT_ITEM | PLANT | |
| Storage Location | GOODSMVT_ITEM | STGE_LOC |
SAP Stock Transfer Posting Upload Template (MB1B)
Move stock between storage locations or plants. One step or two, depending on the movement type.
BAPI_GOODSMVT_CREATEWatch DemoThe same interface as any goods movement. For a transfer posting the goods movement code is 04.
What to watchA transfer has two sides and the item carries both. The issuing side uses PLANT and STGE_LOC, the receiving side uses MOVE_PLANT and MOVE_STLOC. For batch managed materials you need MOVE_BATCH as well, because the receiving batch is not assumed to be the same as the issuing one.
Mandatory fields 12 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Goods Movement Code | GOODSMVT_CODE | GM_CODE | 04 for a transfer posting. |
| Document Date | GOODSMVT_HEADER | DOC_DATE | YYYYMMDD. |
| Posting Date | GOODSMVT_HEADER | PSTNG_DATE | YYYYMMDD. |
| Line | GOODSMVT_ITEM | MATERIAL | Sequential line number for your own reference. |
| Movement Type | GOODSMVT_ITEM | MOVE_TYPE | 311 sloc to sloc, 301 plant to plant one step. |
| Material | GOODSMVT_ITEM | MATERIAL | |
| Quantity | GOODSMVT_ITEM | ENTRY_QNT | |
| Unit of Entry | GOODSMVT_ITEM | ENTRY_UOM | |
| Issuing Plant | GOODSMVT_ITEM | PLANT | |
| Issuing Storage Loc | GOODSMVT_ITEM | STGE_LOC | |
| Receiving Plant | GOODSMVT_ITEM | MOVE_PLANT | |
| Receiving Storage Loc | GOODSMVT_ITEM | MOVE_STLOC |
SAP Reservation Upload Template (MB21)
Create reservations in bulk. An H row is the reservation header and the D rows are its items.
BAPI_RESERVATION_CREATE1Watch DemoA compact interface. The header uses ABAP field names while the item structure uses English BAPI names, which is a frequent source of wrong column mappings.
What to watchThe header uses ABAP field names and the items use English ones, in the same call. The movement type is BWART not MOVE_TYPE, the cost center is KOSTL not COST_CENTER, and the base date is BSTER. Then on the item it is MATERIAL, PLANT and ENTRY_QNT. Mapping the header from the item's naming convention is a common failure.
Mandatory fields 7 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Base Date | RESERVATIONHEADER | BSTER | ABAP field name. Base date for the reservation. YYYYMMDD. |
| Movement Type | RESERVATIONHEADER | BWART | ABAP field name, not MOVE_TYPE. |
| Material | RESERVATIONITEMS | MATERIAL | |
| Plant | RESERVATIONITEMS | PLANT | |
| Quantity | RESERVATIONITEMS | ENTRY_QNT | |
| Unit of Entry | RESERVATIONITEMS | ENTRY_UOM | |
| Requirement Date | RESERVATIONITEMS | REQ_DATE | YYYYMMDD. |
SAP Physical Inventory Document Upload Template (MI01)
Create physical inventory documents. An H row is the document, D rows are the materials to be counted.
BAPI_MATPHYSINV_CREATEWatch DemoThe first of three steps. This creates the document, the count is entered separately, and differences are posted separately again.
What to watchThere is no exporting document number on this BAPI. The new document number comes back only inside the RETURN message variables, not in a typed field. That matters because the count step needs that number, so the loader has to parse it out of the message rather than read a clean export.
Mandatory fields 5 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Plant | HEAD | PLANT | |
| Storage Location | HEAD | STGE_LOC | |
| Document Date | HEAD | DOC_DATE | YYYYMMDD. |
| Planned Count Date | HEAD | PLAN_DATE | YYYYMMDD. |
| Material | ITEMS | MATERIAL |
SAP Physical Inventory Count Entry Upload Template (MI04)
Enter counted quantities against an existing physical inventory document. An H row is the document, D rows are the counted lines.
BAPI_MATPHYSINV_COUNTWatch DemoStep two of three. The document must already exist and the item numbers must be the ones SAP assigned when it was created.
What to watchA counted zero is not the same as a blank. ENTRY_QNT of zero with ZERO_COUNT blank reads as not counted. Set ZERO_COUNT to X for a line genuinely counted at zero, or the difference posting will skip it and the stock will stay on the books.
Mandatory fields 7 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Physical Inventory Doc | PHYSINVENTORY | IBLNR | The document created in step one. |
| Fiscal Year | FISCALYEAR | GJAHR | The document's fiscal year, not the calendar year. |
| Count Date | COUNT_DATE | ZLDAT | YYYYMMDD. |
| Item | ITEMS | ITEM | The line number SAP assigned, not a sequential number of yours. |
| Material | ITEMS | MATERIAL | |
| Counted Quantity | ITEMS | ENTRY_QNT | Zero needs the zero count flag as well. |
| Unit of Entry | ITEMS | ENTRY_UOM |
SAP Inventory Difference Posting Upload Template (MI07)
Post the differences from a counted physical inventory document. An H row is the document, D rows are the lines to post.
BAPI_MATPHYSINV_POSTDIFFWatch DemoStep three of three. The difference is whatever the count step already recorded, so this interface carries no quantities at all.
What to watchThere is no quantity field in this interface at all. The difference is whatever the count step recorded, so this step only identifies which lines to post and why. A template that carries a quantity column here has been modelled on the wrong structure and the column maps to nothing.
Mandatory fields 5 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Physical Inventory Doc | PHYSINVENTORY | IBLNR | The counted document. |
| Fiscal Year | FISCALYEAR | GJAHR | The document's fiscal year. |
| Posting Date | PSTNG_DATE | BUDAT | Period must be open. YYYYMMDD. |
| Item | ITEMS | ITEM | The line number from the inventory document. |
| Material | ITEMS | MATERIAL |
SAP Supplier Invoice, logistics Upload Template (MIRO)
Post supplier invoices against purchase orders, with three way matching. Use FB60 when there is no purchase order.
BAPI_INCOMINGINVOICE_CREATEWatch DemoThe logistics invoice verification interface. It is what makes three way matching and GR/IR clearing work, which FB60 cannot do.
What to watchGROSS_AMOUNT and CALC_TAX_IND interact, and this is where most files fail. With automatic tax calculation on, the sum of the item amounts is net and GROSS_AMOUNT must include the tax. The BAPI rejects the document when the two do not reconcile, and the message does not always make the arithmetic obvious.
Mandatory fields 13 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Invoice Indicator | HEADERDATA | INVOICE_IND | X posts an invoice. Blank posts a credit memo. |
| Company Code | HEADERDATA | COMP_CODE | |
| Invoice Date | HEADERDATA | DOC_DATE | The supplier's invoice date. YYYYMMDD. |
| Posting Date | HEADERDATA | PSTNG_DATE | Period must be open. YYYYMMDD. |
| Reference | HEADERDATA | REF_DOC_NO | The supplier's invoice number. Used by duplicate checking. |
| Gross Amount | HEADERDATA | GROSS_AMOUNT | Total including tax. Must reconcile with the line amounts. |
| Currency | HEADERDATA | CURRENCY | |
| Line Item | ITEMDATA | INVOICE_DOC_ITEM | 00001, 00002. |
| Purchase Order | ITEMDATA | PO_NUMBER | |
| PO Item | ITEMDATA | PO_ITEM | |
| Quantity | ITEMDATA | QUANTITY | |
| Unit of Measure | ITEMDATA | PO_UNIT | |
| Item Amount | ITEMDATA | ITEM_AMOUNT | Net amount for the line. |
SAP Park Supplier Invoice Upload Template (MIR7)
Park supplier invoices for later review and release. An H row is the invoice, D rows are its lines.
BAPI_INCOMINGINVOICE_PARKWatch DemoThe same structures as the invoice create BAPI. What differs is that the document is parked rather than posted, so nothing hits the ledger until someone releases it.
What to watchParking is not posting. The document gets a number and a fiscal year, and nothing reaches the general ledger until someone releases it in MIR4 or MRBR. That makes this the safe route for a bulk load of invoices that need human review, and it means reconciliation has to look at parked documents, not postings.
Mandatory fields 13 fields
| Column | SAP structure | SAP field | Note |
|---|---|---|---|
| Invoice Indicator | HEADERDATA | INVOICE_IND | X for an invoice, blank for a credit memo. |
| Company Code | HEADERDATA | COMP_CODE | |
| Invoice Date | HEADERDATA | DOC_DATE | YYYYMMDD. |
| Posting Date | HEADERDATA | PSTNG_DATE | YYYYMMDD. |
| Reference | HEADERDATA | REF_DOC_NO | The supplier's invoice number. |
| Gross Amount | HEADERDATA | GROSS_AMOUNT | Must reconcile with the line amounts plus tax. |
| Currency | HEADERDATA | CURRENCY | |
| Line Item | ITEMDATA | INVOICE_DOC_ITEM | 00001, 00002. |
| Purchase Order | ITEMDATA | PO_NUMBER | |
| PO Item | ITEMDATA | PO_ITEM | |
| Quantity | ITEMDATA | QUANTITY | |
| Unit of Measure | ITEMDATA | PO_UNIT | |
| Item Amount | ITEMDATA | ITEM_AMOUNT | Net amount for the line. |
After the template
Posting these templates to SAP
Filling in a template is the easy half. PostNow.ai is the other half: it loads the sheet, checks every row against your live SAP system, and posts it through the same SAP interface named on the template, under your own SAP user and authorisations. Nothing is written that you could not write yourself in the SAP GUI, and every row that fails is reported with the SAP message that caused it.
- Load the sheet
- Check every row in live SAP
- Post through the SAP interface
FAQ
Frequently asked questions
How do I mass upload purchase orders into SAP from Excel?
Fill the purchase order template on this page and post it through BAPI_PO_CREATE1. The template uses a header row per order and detail rows per item, so one sheet creates many orders in one run. Mandatory fields and their SAP structures are listed in the template and on its Field Guide tab.
Why does my bulk purchase order change run successfully and change nothing?
Because the change interface ignores any field whose flag is not set. BAPI_PO_CHANGE requires a parallel structure where every field you want written is flagged, and a call with data but no flags returns success and updates nothing. There is a further trap: in the item flag structure the item number field is not a flag and must carry the real item number so the flag row can be matched to its data row. The change template handles both.
How do I post goods movements to SAP in bulk?
Use the goods receipt, goods issue, stock transfer or initial stock template and post it through BAPI_GOODSMVT_CREATE. The movement code on the header and the movement type on each line are what decide the posting, and the two are separate fields that are easy to confuse. PostNow.ai validates both against your live system before anything is posted.
What is the difference between the goods movement code and the movement type?
The movement code identifies the transaction, and the movement type identifies the posting. Code 01 is a goods receipt for a purchase order, 03 a goods issue, 05 another goods receipt. Movement type 101, 201, 311 or 561 then says what actually happens to the stock. The interface needs both, and a valid movement type under the wrong code will be rejected.
Can I load a physical inventory count from Excel?
Yes, in three steps, and this page has a template for each. Create the physical inventory document, enter the counted quantities against it, then post the differences. The count step needs the document number returned by the first step, so run them in order and carry the number across.
How do I upload supplier invoices without a purchase order reference?
Use the vendor invoice template on the finance page, which posts through the accounting interface. The supplier invoice template on this page is for logistics invoice verification, where the invoice references a purchase order and a goods receipt, and it posts through BAPI_INCOMINGINVOICE_CREATE instead.
Can these templates handle both creating and changing purchasing documents?
Yes. This page carries separate create and change templates because SAP uses different interfaces and different behaviour for each. PostNow.ai posts either one through the matching SAP interface, and it sets the change flags automatically from the columns you have filled in.
Keep going