SAP S/4HANA SUPPLY CHAIN

Procure-to-Pay to Order-to-Cash: The Complete S/4HANA Supply Chain Flow

Follow one material from vendor PO to customer payment. See the T-codes, stock and FI postings where procure-to-pay meets order-to-cash in S/4HANA.

Anshuman Behuria
Anshuman BehuriaLead SAP Mentor ยท theTechMentor
Updated
Procure-to-Pay to Order-to-Cash: The Complete S/4HANA Supply Chain Flow
ModuleSAP Logistics
Read time10 min
LevelIntermediate
T-codes covered

LFA1KNA1XK01XD01ME51NME21NMIGOMIRO

Most learners study procure-to-pay (P2P) in an MM batch and order-to-cash (O2C) in an SD batch, and never see them as one loop. In a real project they are two halves of the same trade cycle. Whatever you buy through P2P becomes the stock you sell through O2C, and both cycles end in the same general ledger.

This article follows one material from purchase requisition to vendor payment and then from sales order to customer receipt. You will see the documents, transaction codes, tables and FI postings at each step. You will also see exactly where the procure-to-pay to order-to-cash handover happens: stock, valuation and the warehouse. I use a worked example in INR so you can reproduce it on an S/4HANA sandbox.

โšก Key takeaways
  • Procure-to-pay and order-to-cash are two halves of one loop, joined by stock, valuation, MRP and the Universal Journal.
  • GR (101) debits inventory and credits GR/IR, while PGI (601) debits COGS and credits inventory. Billing posts revenue, not COGS.
  • COGS uses the material's valuation price (standard or moving average), not the selling price.
  • MRP turns sales-order demand into purchase requisitions, so O2C can trigger P2P.
  • With EWM, the FI postings stay the same but physical moves run through warehouse tasks and the EWM delivery.
  • Debug by following the document flow back to the preceding document: PO history for P2P, document flow for O2C.
Process at a glance
  1. 1Requisition and PO (ME51N, ME21N)A need becomes a purchase order to the vendor.
  2. 2Goods receipt (MIGO, 101)Stock rises: Dr Inventory, Cr GR/IR.
  3. 3Invoice and payment (MIRO, F110)Three-way match, then the vendor is paid.
  4. 4Sales order (VA01)Customer demand is checked against stock and credit.
  5. 5Delivery and PGI (VL01N, 601)Stock falls: Dr COGS, Cr Inventory.
  6. 6Billing and receipt (VF01, F-28)Revenue is posted and customer cash comes in.

01Why procure-to-pay to order-to-cash is one loop, not two processes

P2P is the buy side: you need a material, you order it, receive it, verify the vendor invoice and pay. O2C is the sell side: a customer orders, you check availability, deliver, bill and collect. Different departments own them, and different SAP modules (MM and FI-AP versus SD and FI-AR) carry them.

But they share three things, and these three things are where consultants get questions in interviews and where projects get defects:

If you need the foundations first, read the MM organisational structure guide and the SD organisational structure guide. The plant is the object both sides share.

02The procure-to-pay half: documents and postings

The P2P chain has six standard steps. Each step creates a document that the next step references. That reference chain is what the three-way match in invoice verification depends on.

StepT-codeDocument / tableAccounting effect
Purchase requisitionME51NPR, EBANNone (commitment only)
Purchase orderME21NPO, EKKO/EKPONone
Goods receiptMIGO (movement 101)Material doc, MATDOCDr Inventory (BSX), Cr GR/IR (WRX)
Invoice verificationMIROInvoice, RBKP/RSEGDr GR/IR, Dr input tax, Cr Vendor
PaymentF110Payment doc, BKPF/ACDOCADr Vendor, Cr Bank

For the configuration behind the first three steps, see the complete purchase order cycle guide. If requisitions should convert to POs without a buyer touching them, the ME59N automation article covers it.

The GR/IR clearing account is the control point. A GR credits it, and the invoice debits it. Any balance left over means goods received but not invoiced, or invoiced but not received. Month-end teams chase this balance every close.

03The order-to-cash half: documents and postings

O2C mirrors P2P step for step, with the document flow starting from the customer's demand instead of your own.

StepT-codeDocument / tableAccounting effect
Inquiry / quotation (optional)VA11 / VA21VBAK/VBAPNone
Sales orderVA01Order, VBAK/VBAPNone (credit and ATP checks happen here)
Outbound deliveryVL01NLIKP/LIPSNone
Post goods issueVL02N (movement 601)MATDOCDr COGS (GBB/VAX), Cr Inventory (BSX)
BillingVF01VBRK/VBRPDr Customer, Cr Revenue, Cr Output tax
Incoming paymentF-28BKPF/ACDOCADr Bank, Cr Customer

The sales order is where stock and demand first meet. The availability check decides whether the customer's requested date can be met from current stock, planned receipts (including your open POs) or production. The ATP guide for SD consultants shows how checking rules and scope work.

Revenue and receivable accounts come from condition-based account determination in VKOA, while COGS and inventory come from OBYC. The full SD to FI story is in the O2C FI integration and VKOA article, so I will not repeat it here.

04Where P2P hands over to O2C: stock, valuation and planning

This is the part most tutorials skip. There are four handover points between the buy side and the sell side.

1. Stock and the valuation price

When the GR posts, stock quantity and value increase on the material at plant level. The price that O2C later uses to post COGS comes from this valuation. With price control S (standard), COGS uses the standard price and the difference between PO price and standard goes to the price difference account (PRD). With price control V (moving average), the price blends with each receipt.

If you run actual costing, the final cost is only known after the period-end run. See the Material Ledger and actual costing guide. For account mapping, the OBYC masterclass covers BSX, WRX, GBB and PRD.

2. Demand driving procurement

Sales orders create independent requirements for MRP-relevant materials. MRP (MD01N in S/4HANA) then creates purchase requisitions for shortages. That is how O2C triggers P2P. A sales order for 500 pieces with only 200 in stock results in a requisition for the shortfall. The MRP Live article explains how this runs in S/4HANA.

3. Material master views

The same material master holds purchasing views (GR processing time, order unit), sales views (delivering plant, item category group, availability check), MRP views and accounting views. A missing view in either cycle blocks a document. The material master field-by-field guide lists the fields that matter.

4. Special procurement and special stock

Not every P2P ends in plain stock. Consignment stock (see the 411 K and MRKO guide) and subcontracting (special stock O) change when you own the stock and when liability to the vendor arises. A sale from consignment stock is possible only after the transfer to own stock, so the liability posts at withdrawal.

05Worked example: one material through both cycles in INR

Take company code 1000, plant 1000, a traded material TRD-100 on moving average price, GST at 18%. This is simplified, with no TDS and no freight, so you can follow the numbers.

  1. PO: Buy 100 pieces from vendor 100001 at INR 400 each. PO value is INR 40,000.
  2. GR (101): Dr Inventory 40,000, Cr GR/IR 40,000. Stock is 100 pieces valued at INR 40,000.
  3. MIRO: Vendor invoice INR 47,200 (40,000 plus 7,200 GST). Dr GR/IR 40,000, Dr Input CGST 3,600, Dr Input SGST 3,600, Cr Vendor 47,200.
  4. Sales order: Customer 200001 orders 80 pieces at INR 650. ATP confirms 80 from stock.
  5. Delivery and PGI (601): Dr COGS 32,000 (80 x 400), Cr Inventory 32,000. Stock left is 20 pieces valued at INR 8,000.
  6. Billing: Net INR 52,000, GST INR 9,360. Dr Customer 61,360, Cr Revenue 52,000, Cr Output CGST 4,680, Cr Output SGST 4,680.
  7. Payments: You pay the vendor INR 47,200 through F110. The customer pays INR 61,360, which you post with F-28.
MeasureAmount (INR)
Revenue52,000
COGS32,000
Gross margin20,000
Closing inventory (20 pcs)8,000
Net GST payable (9,360 minus 7,200)2,160
Cash movement (in minus out)+14,160

Check your result: run MB52 for plant stock and display the accounting document from each step with FB03. The Universal Journal view in the ACDOCA guide explains why all these lines appear in one table.

06Adding the warehouse: EWM inside both cycles

If the plant's storage location is warehouse-managed with EWM, the physical movements in both cycles run through EWM. The commercial documents stay the same, but a warehouse layer sits between the delivery and the goods movement.

StageWithout EWMWith embedded EWM
InboundGR directly against PO in MIGOInbound delivery, warehouse task for putaway, then GR posted from the delivery
OutboundPick and PGI in VL02NOutbound delivery order, wave, picking warehouse task, then PGI from EWM
Stock viewPlant and storage locationBin-level stock plus the ERP-level quantity

The FI postings are identical, because the GR still posts 101 and the PGI still posts 601. What changes is timing and traceability. See the embedded EWM setup walkthrough, warehouse process types and wave management. For the bigger picture across TM and EWM, read the end-to-end logistics integration guide.

07Procure-to-pay versus order-to-cash: the key differences

AspectProcure-to-payOrder-to-cash
TriggerInternal need (PR, MRP, reorder)External customer demand
Business partnerVendor (supplier role)Customer role
Owner moduleMM and FI-APSD and FI-AR
Stock effectIncreases stock (101)Decreases stock (601)
Key controlThree-way match (PO, GR, invoice)Credit check and ATP
Account determinationOBYC (BSX, WRX)VKOA (revenue) plus OBYC (COGS)
Cash directionOutflowInflow
PricingCalculation schema (M/ME condition types)Pricing procedure (PR00, taxes)

For the pricing differences in detail, compare the MM calculation schema guide with the SD pricing procedure guide.

Are they interrelated? Yes, through stock, valuation, MRP and the ledger. You can run one without the other in a service business, but any trading or manufacturing company runs both, and a failure in one shows up in the other. An invoice blocked in MIRO delays vendor payment, and a PGI that fails for lack of stock holds up billing.

08Common mistakes and troubleshooting across the loop

SymptomLikely causeFix
PGI fails with insufficient stockGR not posted, or stock in blocked/quality status, or wrong storage location in the deliveryCheck MMBE and MB52. Post the GR or correct the storage location.
GR posting fails: posting period not openPeriod closed in OB52Ask FI to open the period. Do not backdate without approval.
Billing document blocked for accountingMissing VKOA account or missing customer reconciliation accountMaintain the key combination in VKOA, then release billing from VFX3.
Invoice blocked in MIROPrice or quantity variance beyond tolerance (OMR6)Review the variance, release in MRBR.
GR/IR balance keeps growingDeliveries not invoiced, or invoices without GRAnalyse with MB5S and clear with F.13 or MR11 where valid.
COGS looks wrong on a salePrice control or price difference on the materialCheck the accounting 1 view and price control. Review in CKM3 if Material Ledger is active.

One habit that saves hours: always display the document flow (VA03 then Display Document Flow, or the PO history tab in ME23N) before you debug. The problem is almost always in a preceding document.

09Interview questions on procure-to-pay to order-to-cash

  1. Walk me through P2P and O2C end to end. Use the two tables above. Give T-codes, documents and the FI posting at each stage.
  2. What posts at goods receipt and at goods issue? GR: Dr Inventory, Cr GR/IR. GI on delivery: Dr COGS, Cr Inventory.
  3. Where does the system get the COGS value? From the valuation price in the material master (standard or moving average), not from the sales price.
  4. How does a sales order create a purchase requisition? Through MRP, which reads the requirements and creates a PR for the shortage. Third-party order processing is the other route, creating a PR directly from the sales order item.
  5. What is the three-way match? PO, goods receipt and vendor invoice are compared on quantity and price in MIRO. Differences beyond tolerance block the invoice.
  6. What changes if EWM is active? The financial postings stay the same. Physical movement runs through warehouse tasks, and the goods movement posts from the EWM delivery.

If you are planning your learning path, the 3-month MM plan places P2P first, and O2C understanding is what turns an MM learner into someone useful in integration discussions.

๐ŸŽ
Free: SAP MM & EWM video course + interview kit

Get the 40+ lesson playlist, the most-asked interview questions and our 90-day roadmap on WhatsApp.

?Frequently asked questions

What is procure to pay order to cash?

It is the full trade cycle of a company. Procure-to-pay covers buying: requisition, PO, goods receipt, invoice verification and vendor payment. Order-to-cash covers selling: sales order, delivery, goods issue, billing and customer payment. Together they take material in, sell it and turn it back into cash.

What is the difference between procure to pay and order to cash?

P2P is the buy side, triggered by your own need, owned by MM and FI-AP, and ends with cash going out. O2C is the sell side, triggered by a customer order, owned by SD and FI-AR, and ends with cash coming in. P2P increases stock with movement 101, and O2C reduces it with 601.

Are procure to pay and order to cash interrelated?

Yes. They share the material master, plant, Business Partner data and the general ledger. Stock links them physically and financially, because what you receive in P2P is what you ship in O2C. MRP also converts sales demand into purchase requisitions.

What are the main T-codes in the procure-to-pay and order-to-cash process?

For P2P: ME51N, ME21N, MIGO, MIRO and F110. For O2C: VA01, VL01N, VL02N for goods issue, VF01 and F-28. Account determination uses OBYC for inventory, GR/IR and COGS, and VKOA for revenue.

Which accounting entries link P2P and O2C?

The inventory account (BSX) is the link. The GR debits it at purchase, and the PGI credits it at sale. The COGS posted at goods issue uses the value that the purchase built into the stock.

Does EWM change the procure-to-pay and order-to-cash flow?

The commercial documents and FI postings remain the same. EWM adds inbound and outbound delivery processing, warehouse tasks, putaway and picking before the goods movement posts. In decentralized EWM, deliveries also replicate between systems.

Which should a fresher learn first, P2P or O2C?

Most MM learners start with P2P because it is easier to follow, then add O2C to understand integration. SD learners do the reverse. Either way, learn the stock and FI postings of both, since interviews test the connection.

Learn SAP hands-on with theTechMentor

Live weekday & weekend batches or 24/7 recorded courses, with S/4HANA practice server access and interview preparation.