Sub topic 2
Organizational Units: Company Code, Plant, Purchasing Organization and Group
This chapter explains the four organizational units that shape every purchasing transaction in SAP S/4HANA. It assumes you know basic purchasing and accounts payable terms, can navigate the SAP GUI or the Fiori launchpad, and understand debits, credits, and general ledger accounts. You do not need to configure anything yourself. You do need to recognize which unit controls which part of a purchase.
Why organizational units matter
Every purchase document carries organizational data. The system uses it to decide which legal entity is billed, where goods arrive, who negotiates prices, and who is responsible for a buying category. If the data is wrong or inconsistent, you see errors such as "Plant is not assigned to company code" or find that a supplier's conditions do not apply.
The four units answer four different questions:
| Unit | Question it answers | Typical field name |
|---|---|---|
| Company code | Which legal entity owns the financial postings? | BUKRS |
| Plant | Where is the stock received and stored, or where is the service used? | WERKS |
| Purchasing organization | Who negotiates and owns the buying conditions? | EKORG |
| Purchasing group | Which buyer or buyer team handles the document? | EKGRP |
Company code
A company code is the smallest organizational unit for which a complete, self-contained set of financial accounts can be drawn up. In practice it is a legal entity, with its own balance sheet and profit and loss statement.
In procure-to-pay, the company code determines:
- Which ledger receives the postings from goods receipt, invoice receipt, and payment.
- The currency of the company code and the chart of accounts used for account determination.
- The fiscal year variant and the open posting periods.
- Which vendor account (the company code view of the supplier) is used for payment.
A purchase order has exactly one company code. The system derives it from the plant on the item, or you enter it on the header.
Plant
A plant is an operational site, such as a factory, warehouse, or distribution center. It is the place where materials are received, stored, and planned. Each plant belongs to exactly one company code. One company code can have many plants.
The plant matters to purchasing in these ways:
- Material master data is maintained per plant. A material must be extended to a plant before you can order it there.
- A goods receipt increases stock in a storage location, which is a subdivision of a plant.
- The plant's valuation area decides at which level the material is valued. In current S/4HANA systems, valuation is almost always at plant level, so the plant also controls the accounting side through account determination.
Because the plant links to the company code, entering a plant on a purchase order item fixes the company code for that item. This is why a single purchase order cannot mix plants from different company codes.
Purchasing organization
A purchasing organization is the unit responsible for negotiating conditions of purchase with suppliers. It is the legal owner of contracts, info records, and source lists in the sense that these records are stored at its level.
Key points:
- Supplier purchasing data (payment terms, order currency, incoterms) is kept per purchasing organization.
- Info records and conditions are valid for a purchasing organization, and optionally for one plant.
- A purchasing organization is assigned to one or more company codes. You can also assign it to plants.
The assignments define the allowed combinations. SAP supports several organizational models:
| Model | Assignment | Typical use |
|---|---|---|
| Plant-specific | Purchasing organization assigned to one plant | A site that buys for itself |
| Company-specific | Purchasing organization assigned to one company code, then to several plants | One buying team for a legal entity |
| Cross-company-code | Purchasing organization assigned to several company codes | Central purchasing for a group |
| Reference purchasing organization | One purchasing organization can use the conditions of another | Sharing negotiated conditions without central ownership |
A purchasing organization that is assigned to a company code but not to a plant can only procure for plants of that company code. To procure for plants of other company codes, you must also allow the plant assignment explicitly. In a cross-company-code setup, the purchasing organization needs a plant assignment for every plant it buys for, and the purchase order specifies the company code that is billed.
Purchasing group
A purchasing group is a buyer or a group of buyers responsible for certain purchasing activities. It is not a legal or financial unit. It has no assignment to a company code, plant, or purchasing organization.
The purchasing group is used for:
- Assigning responsibility. Buyers can filter their worklists by group.
- Reporting and monitoring, for example overdue deliveries per group.
- Release strategies, where the group can be one of the criteria that determine the approval path.
- Defaults. A material master record can store a default group, and the purchase requisition and purchase order copy it.
Because it is not tied to the other units, a group can work across plants and purchasing organizations. Treat it as a responsibility label, not as a security boundary, unless authorization objects are configured to restrict it.
How the units fit together
The diagram shows the typical assignments. The company code is the financial anchor, the plant belongs to it, and the purchasing organization links to company codes and plants. The purchasing group stands apart.
How the system uses the units on a purchase order
When you create a purchase order, the system checks the entries against the assignments.
- You enter a purchasing organization, a purchasing group, and a company code on the header.
- For each item you enter a plant.
- The system confirms that the plant belongs to the company code on the item, or it derives the company code from the plant.
- It checks that the purchasing organization is allowed to buy for that company code and plant.
- It looks for the supplier's purchasing data and info record at the level of the purchasing organization and, where relevant, the plant.
If one check fails, the system stops with an error message. The usual causes are a missing assignment in configuration or a supplier whose purchasing data was never extended to the purchasing organization.
Common errors and how to read them
- Plant not assigned to the company code. The plant you entered is in a different company code from the header. Check the plant's assignment, or change the header.
- Purchasing organization not allowed for the plant. The assignment between the purchasing organization and the plant or company code is missing. This is a configuration task, not a data entry fix.
- Supplier not maintained for the purchasing organization. The supplier exists, but purchasing data for this organization is missing. Extend the supplier business partner with a supplier role for that purchasing organization.
- Material not maintained in the plant. The material master has no plant view for this plant. The next chapters cover material data.
Reading the organizational data in a purchase order
The purchase order header table EKKO stores the company code, purchasing organization, and purchasing group. The item table EKPO stores the plant. You can read them together with ABAP SQL.
SELECT h~ebeln, h~bukrs, h~ekorg, h~ekgrp, i~ebelp, i~werks
FROM ekko AS h
INNER JOIN ekpo AS i ON i~ebeln = h~ebeln
WHERE h~ebeln = @lv_ebeln
ORDER BY i~ebelp
INTO TABLE @DATA(lt_org).
LOOP AT lt_org INTO DATA(ls_org).
WRITE: / ls_org-ebelp, ls_org-bukrs, ls_org-werks, ls_org-ekorg, ls_org-ekgrp.
ENDLOOP.This example assumes that lv_ebeln is declared and holds an existing purchase order number. In a full program you would declare it, for example as DATA lv_ebeln TYPE ekko-ebeln VALUE '4500000001'.
Design decisions
Choosing the structure is a business decision with long-term effects, so it is worth knowing the trade-offs.
- Plant-specific purchasing organizations give local autonomy but duplicate conditions and info records across sites.
- Central purchasing organizations keep conditions in one place and make negotiation simpler. The cost is that every plant assignment must be maintained, and local teams have less control.
- Reference purchasing organizations let a purchasing organization read the conditions of another. They are a middle path, but they add a dependency that you must document.
- Purchasing groups are cheap to create and change, so keep them aligned to real buyer responsibility. Avoid overloading them with unrelated meanings.
Exercise
A purchase order contains two items with plants 1710 and 1720. Plant 1710 belongs to company code 1710, and plant 1720 belongs to company code 1720. Can the system process this purchase order, and why?
Show answer
Not as a single purchase order. Each plant belongs to exactly one company code, and a purchase order has one company code, so the two plants cannot be on the same document. The buyer must create two purchase orders. A purchasing organization assigned to both company codes can place both orders, but each order is still billed to one company code.
Exercise
A buyer sees the error that supplier 0017300001 is not maintained for purchasing organization 1710. Which master data is missing, and which unit stores it?
Show answer
The supplier's purchasing data for purchasing organization 1710 is missing. Payment terms, order currency, and similar data are stored per purchasing organization, so the supplier's business partner must be extended with a supplier role and purchasing data for that organization.