Sub topic 1
The order-to-cash process at a glance
Order-to-cash (O2C) is the chain of steps that turns a customer's request into money in the bank. In SAP S/4HANA it runs through Sales and Distribution (SD), Materials Management (MM) inventory postings, and Financial Accounting (FI). This chapter gives you the whole path so that later chapters can zoom into each step.
Prerequisites
This chapter assumes you already have the following:
- Basic ERP vocabulary: customer, invoice, payment.
- Some navigation experience in SAP GUI or the Fiori launchpad.
- Basic double-entry bookkeeping: debits, credits and receivables.
- Basic SQL reading skills. They are only needed for the optional table examples.
You do not need to know how to configure SAP. The focus is on what happens and which documents SAP creates.
The end-to-end flow
A single customer transaction normally produces a sequence of documents. Each one is a separate record with its own number, and each refers back to its predecessor.
The solid arrows are the logistics and sales flow. The dotted arrows are the accounting side effects.
Steps and documents
| Step | Typical transaction | Document created | Main tables |
|---|---|---|---|
| Inquiry, quotation (optional) | VA11, VA21 | Inquiry, quotation | VBAK, VBAP |
| Sales order | VA01 | Sales order | VBAK, VBAP, VBEP |
| Outbound delivery | VL01N | Delivery, picking | LIKP, LIPS |
| Post goods issue | VL02N | Material document, accounting document | MATDOC, BKPF, ACDOCA |
| Billing | VF01 | Billing document, accounting document | VBRK, VBRP, BKPF, ACDOCA |
| Incoming payment | F-28 or automatic payment | Payment document, clearing | BKPF, ACDOCA |
In S/4HANA you will often use Fiori apps instead of these GUI transactions. Examples are Manage Sales Orders, Create Outbound Deliveries and Create Billing Documents. The documents and tables underneath stay the same.
1. Pre-sales (optional)
An inquiry records a customer's question. A quotation is a binding offer with a validity period. Neither moves stock or posts to accounting. You can copy them into a sales order, which keeps the reference.
2. Sales order
The sales order is the contract with the customer. It holds the sold-to party, the items, the quantities and the prices. Each item has one or more schedule lines. A schedule line is a confirmed quantity with a delivery date, and it comes from the availability check. The order does not post anything to accounting. Pricing, the availability check and the credit check all run while you save it.
3. Outbound delivery and picking
The delivery tells the warehouse what to ship. It is created from the order, normally once the schedule line is due. Picking assigns quantities from storage locations. Packing and loading follow if your process uses them.
4. Post goods issue
Post goods issue (PGI) is the moment ownership of the goods leaves your stock. SAP reduces inventory and creates a material document. It also creates an accounting document that debits cost of goods sold and credits inventory. PGI is the first step that affects the general ledger.
5. Billing
The billing document is the invoice. It is created from the delivery, or directly from the order for services. It copies the prices from the order. Posting it to accounting creates an accounting document:
- Debit: customer receivable, at the gross amount.
- Credit: revenue, at the net amount.
- Credit: tax payable, if tax applies.
6. Incoming payment
When the customer pays, FI posts a debit to the bank account and a credit to the receivable. It then clears the open invoice item against the payment. Clearing links the two items and removes the invoice from the open items list.
Why the document chain matters
Each document is created with a reference to the one before it. SAP stores those links in the document flow table VBFA. This lets you start from any document and walk forward or backward. The sales document category field (VBTYP) identifies the type of each document. Common values are C for order, J for delivery, M for invoice and R for goods movement.
The chain also enforces the process. For example, you cannot normally bill more than was delivered, because billing takes its quantities from the delivery.
Seeing the process in the database
The tables are useful for checking what the screens show. The first query reads one order's header and items. The INNER JOIN links each item in VBAP to its header in VBAK.
DATA(lv_vbeln) = CONV vbeln_va( '0000012345' ).
SELECT h~vbeln, h~auart, h~kunnr,
i~posnr, i~matnr, i~kwmeng, i~vrkme, i~netwr
FROM vbak AS h
INNER JOIN vbap AS i ON i~vbeln = h~vbeln
WHERE h~vbeln = @lv_vbeln
INTO TABLE @DATA(lt_items).AUART is the order type, KUNNR is the sold-to customer, KWMENG is the ordered quantity and NETWR is the net value of the item. The second query finds the immediate follow-on documents of that order:
DATA(lv_vbeln) = CONV vbeln_va( '0000012345' ).
SELECT vbelv, posnv, vbeln, posnn, vbtyp_n
FROM vbfa
WHERE vbelv = @lv_vbeln
INTO TABLE @DATA(lt_flow).In VBFA, VBELV is the preceding document and VBELN is the subsequent one. VBTYP_N tells you what the subsequent document is. A delivery shows J and an invoice shows M.
The third query reads the Universal Journal lines created by one billing document:
DATA(lv_billing) = CONV vbeln_vf( '0090001234' ).
SELECT rbukrs, gjahr, belnr, docln, racct, hsl
FROM acdoca
WHERE rldnr = '0L'
AND awtyp = 'VBRK'
AND awref = @lv_billing
INTO TABLE @DATA(lt_journal).The fields AWTYP and AWREF identify the source document. The value VBRK means a billing document. RLDNR = '0L' selects the leading ledger.
Which organizational units run the process
Every step above happens inside an organizational structure. The sales organization, distribution channel and division determine which customer data and prices apply. The plant and storage location determine where stock is picked. The company code determines which ledger receives the postings. Later chapters cover these in detail. For now, remember that these values are copied from the order into the later documents. A wrong value at order entry will carry through the whole chain.
Common errors
- Expecting accounting at order entry. A sales order creates no accounting document. If you see none, nothing is wrong.
- Billing before goods issue. Standard billing is delivery-related and requires PGI to be complete. An unposted delivery shows up as "not relevant for billing" or a similar status message.
- Confusing the billing document with the accounting document. They have different numbers and live in different tables. VBRK holds the billing document, and BKPF and ACDOCA hold the accounting document.
- Reading old table advice. Older material refers to FI tables such as BSEG and to separate CO tables. In S/4HANA, ACDOCA is the primary source for line items.
- Missing a block. A credit block, delivery block or billing block on an order stops the chain without any error message in the later steps. Always check the status of the preceding document first.
Exercises
Exercise
A customer's invoice has been posted, but the sales order shows no accounting document. Is something wrong, and in which step do the first accounting entries appear?
Show answer
Nothing is wrong. The sales order itself never posts to accounting. The first accounting document is created at post goods issue (debit cost of goods sold, credit inventory). The invoice then posts the receivable and revenue.
Exercise
Write the three accounting entries, in order, for a goods issue, a billing document and an incoming payment. Ignore tax.
Show answer
Goods issue: debit cost of goods sold, credit inventory. Billing: debit customer receivable, credit revenue. Incoming payment: debit bank, credit customer receivable, followed by clearing of the invoice item.
Exercise
You have a delivery number and want the sales order it came from. Which table do you query, and which field holds the preceding document?
Show answer
Query VBFA with VBELN set to the delivery number. The field VBELV then holds the preceding document, which is the sales order.