SAP MM Upload Templates

15 Excel templates for SAP Materials Management: purchase requisitions, purchase orders and order changes, purchase contracts, service entry sheets, goods receipts, goods issues, stock transfers, reservations, physical inventory documents, counts and difference postings, and supplier invoices.

Jump to a template (15)
  1. ME51NPurchase Requisition
  2. ME21NPurchase Order
  3. ME22NPurchase Order Change
  4. ME31KPurchase Contract
  5. ML81NService Entry Sheet
  6. MIGOGoods Receipt against Purchase Order
  7. MB1CGoods Receipt without Purchase Order
  8. MB1AGoods Issue
  9. MB1BStock Transfer Posting
  10. MB21Reservation
  11. MI01Physical Inventory Document
  12. MI04Physical Inventory Count Entry
  13. MI07Post Inventory Differences
  14. MIROSupplier Invoice, logistics
  15. MIR7Park Supplier Invoice
Materials management templates on GitHubFree under the MIT licence, with a README and FAQ for this area.
View on GitHub →

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.

ME51NMaterials ManagementHeader and detail rows 8 of 25 columns mandatory

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.

Posts throughBAPI_PR_CREATEWatch Demo

The 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.

T-codeME51N

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.

Step by step ME51N upload guide

Mandatory fields 8 fields
ColumnSAP structureSAP fieldNote
Document TypePRHEADERPR_TYPENB standard. Almost the only header field that matters.
ItemPRITEMPREQ_ITEM00010, 00020. Also goes into PRITEMX as the join key.
Short TextPRITEMSHORT_TEXTTaken from the material master if Material is filled.
QuantityPRITEMQUANTITY
Unit of MeasurePRITEMUNIT
Delivery DatePRITEMDELIV_DATEYYYYMMDD.
PlantPRITEMPLANT
Purchasing GroupPRITEMPUR_GROUP
ME21NMaterials ManagementHeader and detail rows 12 of 29 columns mandatory

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.

Posts throughBAPI_PO_CREATE1Watch Demo

The Enjoy generation purchase order interface. Same business logic as ME21N, including release strategy.

T-codeME21N

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.

Step by step ME21N upload guide

Mandatory fields 12 fields
ColumnSAP structureSAP fieldNote
Document TypePOHEADERDOC_TYPENB standard.
VendorPOHEADERVENDORMust be extended to the purchasing org.
Purchasing OrgPOHEADERPURCH_ORG
Purchasing GroupPOHEADERPUR_GROUP
Company CodePOHEADERCOMP_CODE
CurrencyPOHEADERCURRENCY
ItemPOITEMPO_ITEM00010, 00020.
Short TextPOITEMSHORT_TEXTRequired when Material is blank.
QuantityPOITEMQUANTITY
Order UnitPOITEMPO_UNIT
Delivery DatePOSCHEDULEDELIVERY_DATEYYYYMMDD.
PlantPOITEMPLANT
ME22NMaterials ManagementHeader and detail rows 2 of 23 columns mandatory

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.

Posts throughBAPI_PO_CHANGEWatch Demo

The 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.

T-codeME22N

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
ColumnSAP structureSAP fieldNote
Purchase OrderPURCHASEORDERPO_NUMBERThe order being changed. Must exist.
ItemPOITEMPO_ITEMAlso goes into POITEMX as NUMC, alongside the PO_ITEMX flag.
ME31KMaterials ManagementHeader and detail rows 11 of 29 columns mandatory

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.

Posts throughBAPI_CONTRACT_CREATEWatch Demo

The largest interface in this set, with 24 TABLES parameters. It follows the standard MM pattern of paired X structures throughout.

T-codeME31K

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
ColumnSAP structureSAP fieldNote
Document TypeHEADERDOC_TYPEMK quantity contract, WK value contract.
VendorHEADERVENDORMust be extended to the purchasing org.
Purchasing OrgHEADERPURCH_ORG
Purchasing GroupHEADERPUR_GROUP
Company CodeHEADERCOMP_CODE
Valid FromHEADERVPER_STARTYYYYMMDD.
Valid ToHEADERVPER_ENDYYYYMMDD.
CurrencyHEADERCURRENCY
ItemITEMITEM_NOAlso goes into ITEMX for row matching, alongside ITEM_NOX.
Short TextITEMSHORT_TEXTRequired when Material is blank.
Order UnitITEMPO_UNIT
ML81NMaterials ManagementHeader and detail rows 8 of 26 columns mandatory

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.

Posts throughBAPI_ENTRYSHEET_CREATEWatch Demo

One 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.

T-codeML81N

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
ColumnSAP structureSAP fieldNote
Purchase OrderENTRYSHEETHEADERPO_NUMBERThe service purchase order.
PO ItemENTRYSHEETHEADERPO_ITEM
Package NumberENTRYSHEETHEADERPCKG_NOThe outline package for this sheet. Must be unique across sheets.
Short TextENTRYSHEETHEADERSHORT_TEXT
Document DateENTRYSHEETHEADERDOC_DATEYYYYMMDD.
Posting DateENTRYSHEETHEADERPOST_DATEYYYYMMDD.
Line PackageENTRYSHEETSERVICESPCKG_NOThe package this line belongs to.
Line NumberENTRYSHEETSERVICESLINE_NOSequential within the package.
MIGOMaterials ManagementHeader and detail rows 12 of 22 columns mandatory

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.

Posts throughBAPI_GOODSMVT_CREATEWatch Demo

The 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.

T-codeMIGO

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.

Step by step MIGO upload guide

Mandatory fields 12 fields
ColumnSAP structureSAP fieldNote
Goods Movement CodeGOODSMVT_CODEGM_CODE01 for a goods receipt against a purchase order.
Document DateGOODSMVT_HEADERDOC_DATEYYYYMMDD.
Posting DateGOODSMVT_HEADERPSTNG_DATEPeriod must be open. YYYYMMDD.
LineGOODSMVT_ITEMMATERIALSequential line number for your own reference.
Movement TypeGOODSMVT_ITEMMOVE_TYPE101 goods receipt, 102 reversal.
Purchase OrderGOODSMVT_ITEMPO_NUMBERMust exist and still have open quantity.
PO ItemGOODSMVT_ITEMPO_ITEM00010, 00020.
MaterialGOODSMVT_ITEMMATERIALMust match the PO item.
QuantityGOODSMVT_ITEMENTRY_QNT
Unit of EntryGOODSMVT_ITEMENTRY_UOM
PlantGOODSMVT_ITEMPLANT
Storage LocationGOODSMVT_ITEMSTGE_LOC
MB1CMaterials ManagementHeader and detail rows 9 of 21 columns mandatory

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.

Posts throughBAPI_GOODSMVT_CREATEWatch Demo

The same interface as any goods movement. For an other goods receipt the goods movement code is 05.

T-codeMB1C

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
ColumnSAP structureSAP fieldNote
Goods Movement CodeGOODSMVT_CODEGM_CODE05 for an other goods receipt.
Document DateGOODSMVT_HEADERDOC_DATEYYYYMMDD.
Posting DateGOODSMVT_HEADERPSTNG_DATEPeriod must be open. YYYYMMDD.
Movement TypeGOODSMVT_ITEMMOVE_TYPE561 initial entry, 501 free goods.
MaterialGOODSMVT_ITEMMATERIAL
QuantityGOODSMVT_ITEMENTRY_QNT
Unit of EntryGOODSMVT_ITEMENTRY_UOM
PlantGOODSMVT_ITEMPLANT
Storage LocationGOODSMVT_ITEMSTGE_LOC
MB1AMaterials ManagementHeader and detail rows 10 of 22 columns mandatory

SAP Goods Issue Upload Template (MB1A)

Issue stock to cost centers, orders or scrap. The movement type decides which assignment is required.

Posts throughBAPI_GOODSMVT_CREATEWatch Demo

The same interface as any goods movement. For an issue the goods movement code is 03.

T-codeMB1A

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
ColumnSAP structureSAP fieldNote
Goods Movement CodeGOODSMVT_CODEGM_CODE03 for a goods issue.
Document DateGOODSMVT_HEADERDOC_DATEYYYYMMDD.
Posting DateGOODSMVT_HEADERPSTNG_DATEYYYYMMDD.
LineGOODSMVT_ITEMMATERIALSequential line number for your own reference.
Movement TypeGOODSMVT_ITEMMOVE_TYPE201 to cost center, 261 to order, 551 scrap.
MaterialGOODSMVT_ITEMMATERIAL
QuantityGOODSMVT_ITEMENTRY_QNT
Unit of EntryGOODSMVT_ITEMENTRY_UOM
PlantGOODSMVT_ITEMPLANT
Storage LocationGOODSMVT_ITEMSTGE_LOC
MB1BMaterials ManagementHeader and detail rows 12 of 21 columns mandatory

SAP Stock Transfer Posting Upload Template (MB1B)

Move stock between storage locations or plants. One step or two, depending on the movement type.

Posts throughBAPI_GOODSMVT_CREATEWatch Demo

The same interface as any goods movement. For a transfer posting the goods movement code is 04.

T-codeMB1B

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
ColumnSAP structureSAP fieldNote
Goods Movement CodeGOODSMVT_CODEGM_CODE04 for a transfer posting.
Document DateGOODSMVT_HEADERDOC_DATEYYYYMMDD.
Posting DateGOODSMVT_HEADERPSTNG_DATEYYYYMMDD.
LineGOODSMVT_ITEMMATERIALSequential line number for your own reference.
Movement TypeGOODSMVT_ITEMMOVE_TYPE311 sloc to sloc, 301 plant to plant one step.
MaterialGOODSMVT_ITEMMATERIAL
QuantityGOODSMVT_ITEMENTRY_QNT
Unit of EntryGOODSMVT_ITEMENTRY_UOM
Issuing PlantGOODSMVT_ITEMPLANT
Issuing Storage LocGOODSMVT_ITEMSTGE_LOC
Receiving PlantGOODSMVT_ITEMMOVE_PLANT
Receiving Storage LocGOODSMVT_ITEMMOVE_STLOC
MB21Materials ManagementHeader and detail rows 7 of 25 columns mandatory

SAP Reservation Upload Template (MB21)

Create reservations in bulk. An H row is the reservation header and the D rows are its items.

Posts throughBAPI_RESERVATION_CREATE1Watch Demo

A 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.

T-codeMB21

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
ColumnSAP structureSAP fieldNote
Base DateRESERVATIONHEADERBSTERABAP field name. Base date for the reservation. YYYYMMDD.
Movement TypeRESERVATIONHEADERBWARTABAP field name, not MOVE_TYPE.
MaterialRESERVATIONITEMSMATERIAL
PlantRESERVATIONITEMSPLANT
QuantityRESERVATIONITEMSENTRY_QNT
Unit of EntryRESERVATIONITEMSENTRY_UOM
Requirement DateRESERVATIONITEMSREQ_DATEYYYYMMDD.
MI01Materials ManagementHeader and detail rows 5 of 20 columns mandatory

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.

Posts throughBAPI_MATPHYSINV_CREATEWatch Demo

The first of three steps. This creates the document, the count is entered separately, and differences are posted separately again.

T-codeMI01

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
ColumnSAP structureSAP fieldNote
PlantHEADPLANT
Storage LocationHEADSTGE_LOC
Document DateHEADDOC_DATEYYYYMMDD.
Planned Count DateHEADPLAN_DATEYYYYMMDD.
MaterialITEMSMATERIAL
MI04Materials ManagementHeader and detail rows 7 of 14 columns mandatory

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.

Posts throughBAPI_MATPHYSINV_COUNTWatch Demo

Step two of three. The document must already exist and the item numbers must be the ones SAP assigned when it was created.

T-codeMI04

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
ColumnSAP structureSAP fieldNote
Physical Inventory DocPHYSINVENTORYIBLNRThe document created in step one.
Fiscal YearFISCALYEARGJAHRThe document's fiscal year, not the calendar year.
Count DateCOUNT_DATEZLDATYYYYMMDD.
ItemITEMSITEMThe line number SAP assigned, not a sequential number of yours.
MaterialITEMSMATERIAL
Counted QuantityITEMSENTRY_QNTZero needs the zero count flag as well.
Unit of EntryITEMSENTRY_UOM
MI07Materials ManagementHeader and detail rows 5 of 12 columns mandatory

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.

Posts throughBAPI_MATPHYSINV_POSTDIFFWatch Demo

Step three of three. The difference is whatever the count step already recorded, so this interface carries no quantities at all.

T-codeMI07

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
ColumnSAP structureSAP fieldNote
Physical Inventory DocPHYSINVENTORYIBLNRThe counted document.
Fiscal YearFISCALYEARGJAHRThe document's fiscal year.
Posting DatePSTNG_DATEBUDATPeriod must be open. YYYYMMDD.
ItemITEMSITEMThe line number from the inventory document.
MaterialITEMSMATERIAL
MIROMaterials ManagementHeader and detail rows 13 of 29 columns mandatory

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.

Posts throughBAPI_INCOMINGINVOICE_CREATEWatch Demo

The logistics invoice verification interface. It is what makes three way matching and GR/IR clearing work, which FB60 cannot do.

T-codeMIRO

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.

Step by step MIRO upload guide

Mandatory fields 13 fields
ColumnSAP structureSAP fieldNote
Invoice IndicatorHEADERDATAINVOICE_INDX posts an invoice. Blank posts a credit memo.
Company CodeHEADERDATACOMP_CODE
Invoice DateHEADERDATADOC_DATEThe supplier's invoice date. YYYYMMDD.
Posting DateHEADERDATAPSTNG_DATEPeriod must be open. YYYYMMDD.
ReferenceHEADERDATAREF_DOC_NOThe supplier's invoice number. Used by duplicate checking.
Gross AmountHEADERDATAGROSS_AMOUNTTotal including tax. Must reconcile with the line amounts.
CurrencyHEADERDATACURRENCY
Line ItemITEMDATAINVOICE_DOC_ITEM00001, 00002.
Purchase OrderITEMDATAPO_NUMBER
PO ItemITEMDATAPO_ITEM
QuantityITEMDATAQUANTITY
Unit of MeasureITEMDATAPO_UNIT
Item AmountITEMDATAITEM_AMOUNTNet amount for the line.
MIR7Materials ManagementHeader and detail rows 13 of 29 columns mandatory

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.

Posts throughBAPI_INCOMINGINVOICE_PARKWatch Demo

The 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.

T-codeMIR7

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
ColumnSAP structureSAP fieldNote
Invoice IndicatorHEADERDATAINVOICE_INDX for an invoice, blank for a credit memo.
Company CodeHEADERDATACOMP_CODE
Invoice DateHEADERDATADOC_DATEYYYYMMDD.
Posting DateHEADERDATAPSTNG_DATEYYYYMMDD.
ReferenceHEADERDATAREF_DOC_NOThe supplier's invoice number.
Gross AmountHEADERDATAGROSS_AMOUNTMust reconcile with the line amounts plus tax.
CurrencyHEADERDATACURRENCY
Line ItemITEMDATAINVOICE_DOC_ITEM00001, 00002.
Purchase OrderITEMDATAPO_NUMBER
PO ItemITEMDATAPO_ITEM
QuantityITEMDATAQUANTITY
Unit of MeasureITEMDATAPO_UNIT
Item AmountITEMDATAITEM_AMOUNTNet 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
Start your 14 day free trial Runs under your own SAP login and authorisations.

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

More SAP upload templates