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.
- 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.
- 1Requisition and PO (ME51N, ME21N)A need becomes a purchase order to the vendor.
- 2Goods receipt (MIGO, 101)Stock rises: Dr Inventory, Cr GR/IR.
- 3Invoice and payment (MIRO, F110)Three-way match, then the vendor is paid.
- 4Sales order (VA01)Customer demand is checked against stock and credit.
- 5Delivery and PGI (VL01N, 601)Stock falls: Dr COGS, Cr Inventory.
- 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:
- Master data. The material master, plant and storage location are used by both. Vendors and customers are both maintained as Business Partners in S/4HANA.
- Stock. A goods receipt (GR) increases stock, and a goods issue (GI) from a delivery decreases it. Stock is the physical and financial bridge between the two cycles.
- The ledger. Both post to the Universal Journal (table
ACDOCA). Inventory, GR/IR, COGS, revenue, vendor and customer balances all sit in one place.
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.
| Step | T-code | Document / table | Accounting effect |
|---|---|---|---|
| Purchase requisition | ME51N | PR, EBAN | None (commitment only) |
| Purchase order | ME21N | PO, EKKO/EKPO | None |
| Goods receipt | MIGO (movement 101) | Material doc, MATDOC | Dr Inventory (BSX), Cr GR/IR (WRX) |
| Invoice verification | MIRO | Invoice, RBKP/RSEG | Dr GR/IR, Dr input tax, Cr Vendor |
| Payment | F110 | Payment doc, BKPF/ACDOCA | Dr 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.
| Step | T-code | Document / table | Accounting effect |
|---|---|---|---|
| Inquiry / quotation (optional) | VA11 / VA21 | VBAK/VBAP | None |
| Sales order | VA01 | Order, VBAK/VBAP | None (credit and ATP checks happen here) |
| Outbound delivery | VL01N | LIKP/LIPS | None |
| Post goods issue | VL02N (movement 601) | MATDOC | Dr COGS (GBB/VAX), Cr Inventory (BSX) |
| Billing | VF01 | VBRK/VBRP | Dr Customer, Cr Revenue, Cr Output tax |
| Incoming payment | F-28 | BKPF/ACDOCA | Dr 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.
- PO: Buy 100 pieces from vendor 100001 at INR 400 each. PO value is INR 40,000.
- GR (101): Dr Inventory 40,000, Cr GR/IR 40,000. Stock is 100 pieces valued at INR 40,000.
- 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.
- Sales order: Customer 200001 orders 80 pieces at INR 650. ATP confirms 80 from stock.
- 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.
- 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.
- Payments: You pay the vendor INR 47,200 through
F110. The customer pays INR 61,360, which you post withF-28.
| Measure | Amount (INR) |
|---|---|
| Revenue | 52,000 |
| COGS | 32,000 |
| Gross margin | 20,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.
| Stage | Without EWM | With embedded EWM |
|---|---|---|
| Inbound | GR directly against PO in MIGO | Inbound delivery, warehouse task for putaway, then GR posted from the delivery |
| Outbound | Pick and PGI in VL02N | Outbound delivery order, wave, picking warehouse task, then PGI from EWM |
| Stock view | Plant and storage location | Bin-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
| Aspect | Procure-to-pay | Order-to-cash |
|---|---|---|
| Trigger | Internal need (PR, MRP, reorder) | External customer demand |
| Business partner | Vendor (supplier role) | Customer role |
| Owner module | MM and FI-AP | SD and FI-AR |
| Stock effect | Increases stock (101) | Decreases stock (601) |
| Key control | Three-way match (PO, GR, invoice) | Credit check and ATP |
| Account determination | OBYC (BSX, WRX) | VKOA (revenue) plus OBYC (COGS) |
| Cash direction | Outflow | Inflow |
| Pricing | Calculation 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
| Symptom | Likely cause | Fix |
|---|---|---|
| PGI fails with insufficient stock | GR not posted, or stock in blocked/quality status, or wrong storage location in the delivery | Check MMBE and MB52. Post the GR or correct the storage location. |
| GR posting fails: posting period not open | Period closed in OB52 | Ask FI to open the period. Do not backdate without approval. |
| Billing document blocked for accounting | Missing VKOA account or missing customer reconciliation account | Maintain the key combination in VKOA, then release billing from VFX3. |
| Invoice blocked in MIRO | Price or quantity variance beyond tolerance (OMR6) | Review the variance, release in MRBR. |
| GR/IR balance keeps growing | Deliveries not invoiced, or invoices without GR | Analyse with MB5S and clear with F.13 or MR11 where valid. |
| COGS looks wrong on a sale | Price control or price difference on the material | Check 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
- 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.
- What posts at goods receipt and at goods issue? GR: Dr Inventory, Cr GR/IR. GI on delivery: Dr COGS, Cr Inventory.
- 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.
- 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.
- 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. - 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.
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.