Sub topic 2
Organizational units that drive the process
This chapter assumes you know basic ERP vocabulary (customer, invoice, payment), can find your way around SAP GUI or the Fiori launchpad, and understand debits, credits and receivables. The optional code needs basic SQL reading skills.
Every document in order-to-cash carries organizational units. They decide which prices apply, which plants can ship, which ledger receives the posting and who is allowed to see the order. Most "the system picked the wrong thing" problems trace back to a wrong or missing assignment here, so this chapter covers the units and how they connect.
The units and what each one controls
| Unit | Type | Main role in order-to-cash |
|---|---|---|
| Client | Technical and legal container | Holds all data. Master data and customizing at client level are shared across everything below. |
| Company code | Financial accounting | Smallest unit with its own balanced books. Receivables, revenue and taxes post here. |
| Sales organization | Sales and distribution | Legally responsible for the sale. Owns pricing, terms and sales statistics. |
| Distribution channel | Sales and distribution | The route to the customer, such as wholesale, retail or web. |
| Division | Sales and distribution | A product grouping, such as spare parts or finished goods. |
| Plant | Logistics | Where stock is held and goods are shipped from. |
| Storage location | Logistics | A stock location inside a plant. |
| Shipping point | Logistics | The place that processes deliveries, such as a dock or a warehouse door. |
| Sales office and sales group | Sales and distribution | Organization of the sales staff, used for responsibility and reporting. |
Company code
A company code is a legal entity in accounting terms. It has its own currency, chart of accounts assignment and fiscal year variant. Every billing document leads to an accounting document in exactly one company code. In S/4HANA that posting lands in the Universal Journal, which later chapters cover.
Sales organization
A sales organization is assigned to exactly one company code. The reverse is not true: one company code can have several sales organizations. This is why a customer invoice always has a clear legal and accounting home.
The sales organization is also the key for much of the sales configuration. Condition records, payment terms, document types and partner functions are often defined per sales organization.
Distribution channel and division
Distribution channel and division refine the sales organization. They are not posting objects, and they do not own stock or accounts. They select data variants. A customer can have different prices, delivery priorities or payment terms per distribution channel. A material can be sold in some channels and not in others.
Plant, storage location and shipping point
The plant is the logistics anchor. Each item of a sales order gets a delivering plant, and this drives the availability check, the shipping point and the stock reduction at goods issue. A plant belongs to exactly one company code, through its valuation area. Stock is valued per plant, so goods issue posts to the correct company code.
A shipping point is assigned to one or more plants. The system proposes a shipping point for each order item from three inputs: the shipping condition of the customer, the loading group of the material and the delivering plant.
The sales area
The combination of sales organization, distribution channel and division is the sales area. A sales order belongs to exactly one sales area. A sales area is valid only if you have assigned the distribution channel and the division to the sales organization in customizing.
The sales area also decides which master data can be used. A customer must be extended to the sales area of the order, and the material must be extended to the sales organization and distribution channel. The system rejects an order if either is missing.
How the assignments are linked
Several links connect the units, and each is a separate customizing step:
- Sales organization to company code. Each sales organization belongs to one company code.
- Distribution channel to sales organization.
- Division to sales organization.
- Sales organization and distribution channel to plant. This tells the system which plants may deliver for that combination.
- Plant to company code, via the valuation area.
- Shipping point to plant.
Each link has a cause for a typical error. If the plant assignment in step 4 is missing, order entry fails with a message that the plant is not defined for the sales organization and distribution channel. If the shipping point link in step 6 is missing, the system cannot propose a shipping point and the delivery cannot be created.
Cross-company-code sales
A sales organization is tied to one company code, but the plant can belong to another. This is a cross-company-code sale. The sales organization's company code bills the customer. The plant's company code supplies the goods. The system then posts to both and creates intercompany postings. This needs additional customizing, such as an intercompany billing type and transfer prices. A missing setup tends to show up late, at goods issue or billing, and not at order entry. You should check the plant's company code whenever a plant is added to a sales area.
Where the organizational data is stored
Each sales document carries its organizational data. The header (VBAK) stores the sales area, sales office and sales group. The item (VBAP) stores the plant and storage location. The assignments themselves are in customizing tables, for example TVKO for sales organizations with their company code.
The first query shows how many order items each sales area and plant combination has for one sales organization:
DATA(lv_vkorg) = CONV vkorg( '1010' ).
SELECT h~vkorg, h~vtweg, h~spart, i~werks,
COUNT( * ) AS item_count
FROM vbak AS h
INNER JOIN vbap AS i ON i~vbeln = h~vbeln
WHERE h~vkorg = @lv_vkorg
GROUP BY h~vkorg, h~vtweg, h~spart, i~werks
INTO TABLE @DATA(lt_org_usage).The second query reads which company code each sales organization belongs to:
SELECT vkorg, bukrs
FROM tvko
INTO TABLE @DATA(lt_vkorg_cc).If a plant in the first result belongs to a different company code than the one in the second result, you are looking at a cross-company-code sale.
Design decisions and trade-offs
Choosing the structure is one of the earliest and hardest-to-change decisions in an implementation. Documents already posted keep their organizational data, so restructuring later means data migration or parallel structures.
- One sales organization per legal entity is the common default. It keeps pricing and statistics clean, and the link to the company code is unambiguous.
- Separate sales organizations within one company code make sense when sales teams need different pricing, terms or reporting while sharing one set of books.
- Many distribution channels increase flexibility but multiply master data maintenance. Each customer and material needs an extension per sales area.
- Divisions are often best kept few. They can force separate orders, deliveries and invoices when items belong to different divisions, depending on your setup.
Common errors
- A customer is not extended to the sales area, so order entry fails with a message that the sold-to party is not defined for the sales area.
- A material is missing in the sales organization or distribution channel, so the item cannot be entered.
- A plant has no assignment to the sales organization and distribution channel.
- A shipping point is not found because shipping condition, loading group or plant has no matching entry.
- A cross-company-code sale lacks intercompany billing setup, and the failure appears at billing.
Exercise
A sales order for sales organization 1010 fails because plant 2000 is "not defined for the sales organization and distribution channel". Which assignment is missing, and which unit must the plant belong to for goods issue to post correctly in the same company code as the billing?
Show answer
The assignment of sales organization 1010 and the order's distribution channel to plant 2000 is missing, and you add it in customizing. For the sale to stay within one company code, plant 2000 must belong, through its valuation area, to the same company code as sales organization 1010. If it belongs to a different company code, the sale is a cross-company-code sale and needs intercompany billing setup.