Sub topic 10
Sales and Distribution
Sales and Distribution (SD) handles everything from a customer inquiry to the billing document that hands the revenue over to Finance. This chapter assumes you know the basics of an ERP system, the business-partner model from the earlier chapters, and relational concepts such as keys and joins. It also assumes you know how the organizational structure works, because SD relies on it more than any other area does.
What SD is responsible for
SD owns the customer-facing half of the order-to-cash process. It covers:
- Pre-sales documents: inquiries and quotations.
- Sales orders, including pricing, availability checks, and credit checks.
- Outbound delivery, picking, and goods issue (shared with Inventory).
- Billing: invoices, credit memos, and debit memos.
- Pricing conditions, output (printed or electronic documents), and partner determination.
SD does not hold stock quantities or ledger balances. It creates documents that trigger movements in Inventory and postings in Finance.
Organizational elements used by SD
A sales document needs a context in the organizational structure. The context determines which prices, terms, and shipping rules apply.
| Element | Role in SD |
|---|---|
| Sales organization | Legally and commercially responsible unit that sells. It is assigned to one company code. |
| Distribution channel | Route to the customer, such as direct sales, wholesale, or web shop. |
| Division | Product grouping, such as bikes or accessories. |
| Plant | Where the goods are shipped from. |
| Shipping point | Where delivery processing happens inside a plant. |
The combination of sales organization, distribution channel, and division is called a sales area. A customer must be extended to a sales area before you can sell to them. A material must be extended to the same sales organization and distribution channel. If an order fails with a message that the customer or material is not maintained for the sales area, this is almost always the cause.
Master data in SD
SD uses the customer role of the business partner. The general data is shared. The sales area data (currency, incoterms, payment terms, shipping conditions, pricing group) is specific to each sales area. A single customer can therefore have different terms in different sales areas.
From the material master, SD uses the sales organization view (delivery plant, sales unit, tax classification) and the availability check settings. Condition records, which hold prices, discounts, and surcharges, are the third major master data object.
The document flow
SD documents are chained together. Each document keeps a reference to its predecessor, and the chain is called the document flow.
Inquiry -> Quotation -> Sales order -> Outbound delivery -> Goods issue -> Billing documentEach document has a header and items. Header data applies to the entire document, such as the customer and the sales area. Item data applies to one line, such as the material, quantity, and net value. Items can also have schedule lines, which record confirmed delivery dates and quantities.
The following query reads the header table VBAK and the item table VBAP for one sales organization.
SELECT FROM vbak
INNER JOIN vbap ON vbap~vbeln = vbak~vbeln
FIELDS vbak~vbeln, vbak~kunnr, vbap~posnr, vbap~matnr, vbap~netwr
WHERE vbak~vkorg = '1010'
INTO TABLE @DATA(order_items)
UP TO 100 ROWS.The join key is the sales document number vbeln. The header supplies the customer (kunnr). The item supplies the position number (posnr), the material (matnr), and the net value (netwr). This is how a sales document links a customer to materials.
The table VBFA stores the document flow itself. It lists predecessor and successor documents, which lets you trace an invoice back to the order that caused it.
Pricing
Pricing in SD uses the condition technique. Instead of a price field on the material, the system searches for valid condition records during order entry.
- A pricing procedure lists the condition types in order, such as base price, customer discount, freight, and tax.
- Each condition type has an access sequence, which is a list of condition tables to search.
- The system searches the tables in order and takes the first record that matches.
- The results are added up into a net value, which appears on the item as
netwr.
The first match wins within an access sequence, so more specific tables (customer and material) are searched before general ones (material only). Pricing problems usually have one of three causes: no valid condition record for the date, a missing entry in the pricing procedure, or an access sequence that never reaches the table that holds the record.
Availability check and delivery
When an item is entered, the system runs an availability check, often called ATP (available to promise). It compares requested quantities with stock, planned receipts, and planned issues, then writes confirmed quantities to the schedule lines. Quantities that cannot be confirmed move the delivery date out.
An outbound delivery is created from the order. It is the shipping document. The warehouse picks, packs, and posts goods issue. Goods issue reduces stock in Inventory and creates an accounting document that debits cost of goods sold and credits inventory. This is the first financial effect of the sale, and it uses the material's valuation, not the selling price.
Billing and the hand-off to Finance
A billing document is created from the delivery or directly from the order. When it is released to accounting, the system posts:
- A debit to the customer receivable, for the invoice amount including tax.
- A credit to revenue, for the net amount.
- A credit to tax payable.
These lines land in the Universal Journal (table ACDOCA). The billing document number is stored on the accounting entry, so a Finance user can drill from a revenue line back to the invoice, the delivery, and the order. The customer payment later clears the receivable and completes the order-to-cash process.
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).This query sums amounts in company code currency per G/L account for the leading ledger 0L. Revenue accounts in the result include the postings that billing created.
Edge cases and common errors
- Incompletion. An order can be saved with missing required fields. The incompletion log blocks delivery or billing until they are filled in.
- Credit blocks. Credit management can block an order. It stays out of delivery until someone releases it.
- Partial deliveries and split billing. One order can produce several deliveries, and one delivery can feed several billing documents. Do not assume a one-to-one flow.
- Returns and credit memos. A return order reverses the flow. Goods come back through a returns delivery, and a credit memo reduces the receivable.
- Pricing date. The system prices on a date determined by settings. A condition record valid today may not apply to an order priced on a different date.
- Missing account determination. If billing cannot find the revenue account for the combination of sales area, customer group, and material group, it fails when posting to accounting, not when you create the invoice.
Summary of what SD connects to
| Step | SD document | Effect elsewhere |
|---|---|---|
| Order entry | Sales order | Availability check against Inventory and planning |
| Shipping | Outbound delivery | Goods issue reduces stock and posts cost of goods sold |
| Invoicing | Billing document | Receivable and revenue posted in the Universal Journal |
| Payment | Customer payment | Receivable cleared in Finance |
Exercise
A customer orders a material, and the system reports that the material is not maintained for the sales area. Name two master data records you would check and explain why each could cause the error.
Show answer
Check the customer's sales area data in the business partner, because the customer must be extended to the sales organization, distribution channel, and division. Check the material master's sales organization view, because the material must be extended to the same sales organization and distribution channel. Either extension missing blocks order entry.
Exercise
Goods issue has been posted for a delivery, but no billing document exists yet. Which accounting entries exist, and which are still missing?
Show answer
Goods issue has posted a debit to cost of goods sold and a credit to inventory, valued at the material's valuation price. The customer receivable, the revenue credit, and the tax posting are still missing, because they are created only when the billing document is released to accounting.