Sub topic 12
How the Modules Connect: End-to-End Processes
What this chapter assumes
You should know the module areas from earlier chapters: Finance and Controlling, Procurement, Sales, Inventory, and Production Planning. You should also know the organizational units (company code, plant, purchasing and sales organization) and the shared master data (business partner, material). Basic SQL joins are enough for the code. This chapter shows how those pieces work together in the four standard end-to-end processes.
Documents carry the process, not modules
A business process in S/4HANA is a chain of documents. Each step creates a document in one module. Some steps also create an accounting document in Finance. The modules do not call each other directly. Each document stores a reference to its predecessor, and posting logic in Finance reads that reference.
Two properties make this work:
- Shared keys. Every document uses the same organizational units and master data. A purchase order and a goods receipt both name the same plant, material, and supplier, so Finance can attribute the posting.
- One financial store. Every posting with financial impact ends up as lines in the Universal Journal table ACDOCA, whichever module caused it.
The four named processes are:
| Process | Starts with | Ends with | Modules involved |
|---|---|---|---|
| Procure-to-pay (P2P) | Need for a material or service | Payment to the supplier | Procurement, Inventory, Finance |
| Order-to-cash (O2C) | Customer order | Payment received | Sales, Inventory, Finance |
| Plan-to-produce | Demand forecast or sales demand | Finished goods in stock | Planning, Manufacturing, Inventory, Controlling |
| Record-to-report (R2R) | Postings in a period | Financial statements | Finance and Controlling |
Procure-to-pay (Procurement -> Inventory -> Finance)
Purchase requisition -> Purchase order -> Goods receipt -> Supplier invoice -> Payment
Order-to-cash (Sales -> Inventory -> Finance)
Sales order -> Delivery -> Goods issue -> Billing document -> Customer paymentProcure-to-pay
In P2P, the first two documents are commitments and create no accounting entries:
- A purchase requisition records an internal need.
- A purchase order commits the company to a supplier (a business partner with the supplier role) for a quantity and price.
Postings begin at the goods receipt. It creates a material document in Inventory and an accounting document in Finance:
- Debit inventory (or a consumption account for non-stock items).
- Credit the goods receipt/invoice receipt clearing account, often called GR/IR.
The supplier invoice is then matched against the order and the receipt:
- Debit GR/IR, which clears the receipt.
- Credit the supplier's payable account.
The payment debits the payable and credits the bank account.
GR/IR is a clearing account. It holds goods received that have not been invoiced yet, and invoices received for goods that have not arrived. At period end, a nonzero balance means open items to investigate.
Order-to-cash
O2C mirrors P2P on the sales side:
- A sales order records the customer's demand and fixes price, quantity, and delivery date. It makes no posting. It can trigger an availability check or a requirement for planning.
- A delivery instructs the warehouse to pick and ship.
- The goods issue reduces stock. Finance debits cost of goods sold and credits inventory, valued at the material's current value.
- The billing document debits the customer receivable and credits revenue (plus tax accounts).
- The customer payment debits the bank and clears the receivable.
The goods issue and the billing document each post separately. This is why a shipped but unbilled order can show cost without revenue in a period. Finance often accrues revenue for these items at period end.
Plan-to-produce
Manufacturing joins Inventory, Planning, and Controlling:
- Planning (MRP) compares demand with stock and open supply. It creates planned orders for items to make and requisitions for items to buy.
- A planned order becomes a production order with a bill of materials (components) and a routing (operations).
- Goods issues move components from stock into the order. Finance debits the order's cost and credits inventory.
- Confirmations record labor and machine time. Controlling charges these activities to the order.
- A goods receipt for the finished product moves it into stock. Finance credits the order and debits inventory at standard or actual cost.
- Settlement clears the remaining order balance, such as price or usage variances, to the right accounts.
Plan-to-produce is where Controlling shows most clearly. The production order is a cost object, and its balance is the cost of making the product.
Record-to-report
R2R receives what the other processes post and turns it into reports. Typical steps are:
- Post accruals and deferrals, such as unbilled revenue or uninvoiced services.
- Revalue foreign-currency open items.
- Run depreciation for fixed assets.
- Allocate and settle costs in Controlling.
- Reconcile intercompany balances and check clearing accounts such as GR/IR.
- Close the period and produce the balance sheet and income statement.
In earlier SAP generations, reconciling the general ledger with Controlling was a major task, because the data lived in separate tables. The Universal Journal removes most of it, since both views read the same lines.
How the flow looks
Account determination: how a document knows its accounts
Users do not pick accounts for stock movements. Finance configuration does, based on the document's attributes:
- The material's valuation class groups materials that share accounts.
- The movement type (goods receipt, goods issue, and so on) selects a posting key.
- The chart of accounts and company code select the actual G/L account.
For billing, the account is found from attributes such as the customer's account assignment group, the material's account assignment group, and the sales area. A wrong or missing configuration is the most common reason a document posts to the wrong account, or fails with a "no account determined" error.
Tracing a process in the data
Every ACDOCA line records which process created it. The fields awtyp (reference procedure), awref (reference document), and belnr (accounting document) link a financial line back to its operational origin. The next report counts journal lines by origin for one company code and year.
REPORT zdemo_origin_count.
SELECT awtyp, COUNT( * ) AS line_count
FROM acdoca
WHERE rldnr = '0L'
AND rbukrs = '1010'
AND gjahr = '2024'
GROUP BY awtyp
ORDER BY line_count DESCENDING
INTO TABLE @DATA(origins).
LOOP AT origins INTO DATA(origin).
WRITE: / origin-awtyp, origin-line_count.
ENDLOOP.Typical values include MKPF for goods movements, RMRP for supplier invoices from logistics, and VBRK for billing documents. Which values appear depends on your system's activity.
To see the balance each account carries, aggregate the amount in company code currency:
REPORT zdemo_balances.
SELECT rbukrs, racct, SUM( hsl ) AS balance
FROM acdoca
WHERE rldnr = '0L'
AND rbukrs = '1010'
AND gjahr = '2024'
GROUP BY rbukrs, racct
INTO TABLE @DATA(balances).
LOOP AT balances INTO DATA(account).
WRITE: / account-rbukrs, account-racct, account-balance.
ENDLOOP.The sales side keeps its own chain, readable through the sales document tables, for example by joining VBAK (header) to VBAP (items). The document flow table VBFA links each sales document to its follow-ups, such as delivery and billing.
Common errors
- Posting before the master data is complete. A material without a valuation view for the plant cannot receive goods. A supplier without a company code role cannot be invoiced.
- Mixed currencies in a sum.
hslis in company code currency. Do not add it across company codes with different currencies without converting. - Assuming a sales order posts to Finance. It does not. Only goods issue and billing do. If revenue is missing, check which step has not happened.
- Ignoring GR/IR and unbilled deliveries at period end. These are the usual reasons a balance sheet does not match what the operations team reports.
- Quantity and value mismatches. Invoice price and order price can differ. The difference goes to a price difference account, or the invoice is blocked for review, depending on tolerances.
Exercise
A company ships a customer order on 30 June and sends the invoice on 2 July. Which operational document creates a financial posting in June, and what does it post? What does the reported result look like at the end of June if nothing else is done?
Show answer
The goods issue posts in June. It debits cost of goods sold and credits inventory. The billing document is created in July, so no revenue or receivable exists yet. June shows the cost without the revenue unless Finance posts an accrual for the unbilled delivery.
Exercise
In procure-to-pay, which account is credited at goods receipt and debited at invoice receipt, and what does a remaining balance on it tell you?
Show answer
The GR/IR clearing account. A remaining balance means goods were received but not invoiced (or invoiced but not received), so open items need follow-up before closing the period.