Sub topic 10
Related Units: Purchasing Organisation, Sales Organisation, and Controlling Area
Prerequisites
This chapter assumes you know the core chain from earlier chapters: client, company code, plant, and storage location. You should know that a plant belongs to exactly one company code. You should also be comfortable reading a simple SELECT ... INNER JOIN in ABAP. No new configuration skills are needed.
Why more units are needed
The core chain answers where money is booked (company code) and where goods are handled (plant and storage location). It does not say who negotiates with suppliers, who sells to customers, or where internal costs are analysed. SAP models those three questions with separate organisational units:
- The purchasing organisation covers procurement.
- The sales organisation covers selling.
- The controlling area covers internal cost accounting.
Each unit is assigned to the core chain at a defined point. None of them replaces a company code or a plant. They add other views of the same enterprise.
The purchasing organisation
A purchasing organisation (key EKORG, four characters) is the unit responsible for negotiating conditions with vendors. It owns purchasing info records, outline agreements, and the purchasing data in the vendor master record. Purchase orders are created under one purchasing organisation.
A related object is the purchasing group (EKGRP). It is a buyer or team key used for responsibility and reporting. It is not part of the legal or logistical structure and has no assignment to a company code.
Assignments
A purchasing organisation has two kinds of assignment:
- To a company code (optional). This decides which company code is liable when the purchasing organisation orders. The assignment is not required.
- To plants (many). This decides which plants the purchasing organisation can procure for.
This gives three common models:
| Model | Company code assignment | Plant assignment | Typical use |
|---|---|---|---|
| Company-specific | One company code | Plants of that company code | Each legal entity buys for itself |
| Cross-company-code | None | Plants of several company codes | Central purchasing for a group |
| Plant-specific | One company code | A single plant | Local buying at one site |
A purchasing organisation can also be a reference purchasing organisation for another. The second one then uses the conditions negotiated by the first.
A purchasing organisation can be assigned to at most one company code, but it can be assigned to plants of several company codes when no company code is assigned. A plant can be assigned to several purchasing organisations.
Why the model matters
With a cross-company-code purchasing organisation, a purchase order for plant 1000 (company code A) and one for plant 2000 (company code B) come from the same purchasing organisation. Each order is still posted to the company code of its plant. Purchasing is centralised, but accounting stays separate.
The sales organisation
A sales organisation (key VKORG, four characters) is the unit responsible for selling goods and services. It is legally responsible for the sale and for its conditions, such as prices and terms of payment. Sales documents such as sales orders, deliveries, and billing documents all carry a sales organisation.
Two further units complete the selling structure:
- The distribution channel (
VTWEG) is the route to the customer, for example wholesale, retail, or online. - The division (
SPART) is a product line.
The combination of sales organisation, distribution channel, and division is a sales area. Customer master data and sales prices are kept at sales-area level.
Assignments
- A sales organisation is assigned to exactly one company code. This is how revenue reaches financial accounting. A company code can have many sales organisations.
- A plant is assigned to a combination of sales organisation and distribution channel. This tells the system which plants can deliver for that selling route. A plant can serve many sales organisations, and one sales organisation can use many plants.
Delivering from a different company code
The sales organisation and the delivering plant may belong to different company codes. This is a cross-company-code sale. The system then creates an internal billing between the two company codes. Your design must support this case if a central sales unit sells goods stored in another legal entity.
The controlling area
A controlling area (key KOKRS, four characters) is the organisational unit for internal cost accounting (Controlling, or CO). Cost centres, internal orders, and profit centres are defined within it. Financial accounting reports to external parties by company code. Controlling reports to management by controlling area.
Assignments
- A company code is assigned to exactly one controlling area.
- A controlling area can contain several company codes. This allows cost analysis across legal entities.
When a controlling area contains several company codes, the company codes must share the same operating chart of accounts. They may use different currencies. The controlling area has its own currency setting, either a currency of the controlling area or the currency of each company code.
Controlling area and operating concern
Above the controlling area sits the operating concern (ERKRS) used for profitability analysis. One operating concern can include several controlling areas. This chapter does not go further than naming it.
A common simple design is a one-to-one setup: one company code and one controlling area, with the same key. This is easy to manage. A single controlling area for several company codes is useful when you need shared cost objects or cross-company allocations.
How the units fit together
The diagram shows two patterns. The company code is the anchor for controlling areas, sales organisations, and optionally purchasing organisations. The plant is the anchor for the logistics side: purchasing organisations and sales-organisation and distribution-channel combinations point to plants.
Comparison
| Unit | Key | Answers the question | Assignment to company code | Assignment to plant |
|---|---|---|---|---|
| Purchasing organisation | `EKORG` | Who buys? | Optional, at most one | Many plants |
| Sales organisation | `VKORG` | Who sells? | Mandatory, exactly one | Many, through a distribution channel |
| Controlling area | `KOKRS` | Where are costs analysed? | A company code belongs to exactly one | None |
Reading the assignments in the database
The assignment tables are customizing tables, so you can read them with Open SQL. The main ones:
T024Eholds purchasing organisations and their company code.T024Wassigns purchasing organisations to plants.TVKOholds sales organisations and their company code.TKA01holds controlling areas.TKA02assigns company codes to controlling areas.
The following report lists which purchasing organisation can buy for which plant. For cross-company-code purchasing organisations the company code column is blank.
REPORT z_purchasing_plants.
SELECT p~ekorg,
p~bukrs,
w~werks,
w~name1
FROM t024e AS p
INNER JOIN t024w AS a ON a~ekorg = p~ekorg
INNER JOIN t001w AS w ON w~werks = a~werks
ORDER BY p~ekorg, w~werks
INTO TABLE @DATA(lt_purch)
UP TO 50 ROWS.
LOOP AT lt_purch INTO DATA(ls_purch).
WRITE: / ls_purch-ekorg, ls_purch-bukrs, ls_purch-werks, ls_purch-name1.
ENDLOOP.This second report shows the controlling area for each company code, and the sales organisations with their company codes:
REPORT z_company_code_links.
SELECT k~bukrs,
k~kokrs,
c~bezei
FROM tka02 AS k
INNER JOIN tka01 AS c ON c~kokrs = k~kokrs
ORDER BY k~bukrs
INTO TABLE @DATA(lt_controlling)
UP TO 50 ROWS.
LOOP AT lt_controlling INTO DATA(ls_ctrl).
WRITE: / ls_ctrl-bukrs, ls_ctrl-kokrs, ls_ctrl-bezei.
ENDLOOP.
SELECT vkorg, bukrs
FROM tvko
ORDER BY vkorg
INTO TABLE @DATA(lt_sales_orgs)
UP TO 50 ROWS.
LOOP AT lt_sales_orgs INTO DATA(ls_sales).
WRITE: / ls_sales-vkorg, ls_sales-bukrs.
ENDLOOP.The TKA02 table also has a business area field (GSBER). In most systems it is blank for the company-code-to-controlling-area assignment.
Maintaining the assignments
You maintain these units in the Implementation Guide (transaction SPRO), not in the tables directly. Common transactions are OX01 (define purchasing organisation), OX08 (assign it to a company code), OX17 (assign it to a plant), OVX5 (define sales organisation), OVX3 (assign it to a company code), OKKP (maintain controlling area), and OX19 (assign company code to controlling area). Transaction codes can differ by release, so confirm them in the IMG path if one does not open. The next chapter covers customizing in more detail.
Common mistakes
- Assuming a purchasing organisation always has a company code. Code that joins
T024Eto company code data with an inner join silently drops cross-company-code purchasing organisations whoseBUKRSis blank. Use the plant assignment throughT024Wwhen you need a complete list. - Mixing up the two sides of the chain. Purchasing and sales organisations are not owned by a plant. The plant assignment only says which plants they may work with.
- Giving the sales organisation to two company codes. This is not allowed. If two legal entities sell to customers, each needs its own sales organisation.
- Putting company codes with different operating charts of accounts into one controlling area. The system will not allow it. Plan the chart of accounts before you plan the controlling area.
- Treating the purchasing group as an organisational unit. It is a responsibility key. It is not assigned to a company code or plant.
- Changing assignments after documents exist. Changing the company code of a sales organisation or the controlling area of a company code after postings exist is restricted or blocked. Settle these assignments in the design phase.
Exercises
Exercise
A group buys all raw materials for plants in company codes 1000 and 2000 through one central purchasing team, but each company code must keep its own accounting. Which purchasing organisation model fits, and why?
Show answer
A cross-company-code purchasing organisation. It has no company code assignment and is assigned to plants of both company codes. Purchasing is centralised, and each purchase order is still posted to the company code of its plant.
Exercise
Your ABAP report joins T024E to T024W and uses an inner join on a company code table through T024E-BUKRS. A central purchasing organisation is missing from the output. What is the likely cause, and how do you fix it?
Show answer
The central purchasing organisation has a blank BUKRS because it is not assigned to a company code, so the inner join on company code drops it. Remove that join, or use a left outer join, and take the company code from the plant through T001W and T001K instead.
Exercise
A sales organisation sells to customers on behalf of company code 1000 but also needs to book revenue in company code 2000. Is this allowed?
Show answer
No. A sales organisation is assigned to exactly one company code. Create a second sales organisation for company code 2000. If goods come from a plant in another company code, use a cross-company-code sale with internal billing.