Sub topic 1
Why SAP Models the Enterprise as Organisational Units
Prerequisites
This chapter assumes you already have the following:
- A basic idea of what an ERP system does, meaning one system that supports finance, purchasing, production, sales, and warehousing.
- Familiarity with those business functions, such as posting an invoice, receiving goods, or planning production.
- A working understanding of relational tables, primary keys, and joins.
- Optionally, some experience logging on to an SAP system and reading ABAP. The one code example is short and explained line by line.
This is the first of 13 chapters. It gives the overall model. Later chapters cover each unit in detail.
The problem organisational units solve
A real enterprise is not one flat thing. It has legal entities that file tax returns. It has factories, distribution centres, and shops. Inside those sites it has warehouses, shelves, and receiving docks. Different departments care about different parts of this picture.
- Accounting must report per legal entity.
- Production planners need to know which site makes what.
- Warehouse staff need to know which physical area holds a pallet.
- Buyers negotiate prices for groups of sites at once.
If SAP stored every record with no structural context, none of these views could be separated. A goods receipt would just be "100 units of material X arrived", with no answer to the questions that matter. Which company owns them? Which site holds them? Which warehouse area are they in? Which ledger takes the value?
SAP solves this by requiring every business transaction and most master data to be tied to organisational units. These units form a model of the enterprise inside the system.
What an organisational unit is
An organisational unit is an element of the enterprise structure that you define once in customizing (the configuration area of SAP) and then reference from master data and transactions. It does three jobs.
- It scopes data. Data is stored at the level where it applies. A material's base unit of measure is the same everywhere, but its stock quantity is specific to a plant and storage location.
- It scopes responsibility. Reports, authorisations, and legal duties attach to a unit. A balance sheet is produced per company code, not per plant.
- It scopes configuration. Many settings, such as number ranges, currencies, and calendars, are defined per unit and apply to everything below it.
Organisational units are not master data like a customer or a material. They change rarely, and changing them after go-live is expensive. That is why this model comes before nearly everything else in an SAP project.
The four units in this tutorial
Many organisational units exist in SAP. This tutorial focuses on four that together describe where a business transaction happens, legally, operationally, and physically.
| Unit | Business meaning | Typical key |
|---|---|---|
| Client | The self-contained top-level unit of an SAP system, with its own data and users | Three-digit number, for example 100 |
| Company code | The smallest unit for which a complete, self-contained set of accounts can be drawn up | Four characters, for example 1000 |
| Plant | An operational site for production, procurement, planning, or distribution | Four characters, for example 1000 |
| Storage location | A place within a plant where stock is physically kept | Four characters, unique only within a plant |
Two other units appear in the plan and get their own chapters. The company groups company codes for consolidation, and the valuation area determines at which level inventory is valued. Both sit between the four main units and explain why the assignments work the way they do.
The hierarchy at a glance
The units nest from the broadest to the most specific. A client contains company codes. A plant is assigned to one company code. A storage location belongs to one plant.
Read the diagram with these rules in mind.
- Everything sits inside one client. Nothing is shared between clients.
- Each plant has exactly one company code above it. A company code can have many plants.
- Each storage location has exactly one plant above it. A plant can have many storage locations.
- The two storage locations named
0001under plants 1000 and 1100 are different objects. The same key can recur because a storage location is identified only in combination with its plant.
Seeing the structure from different business angles
The same enterprise looks different from each function. SAP does not use one tree for everything. It uses several organisational units, each answering a question for a particular function, and links them.
- Financial accounting looks at the company code. Postings, balance sheets, and profit and loss statements are per company code.
- Logistics looks at the plant and storage location. Material requirements planning, production orders, and stock all live here.
- Purchasing and sales use a purchasing organisation and a sales organisation. These are not part of the plant hierarchy, but they link to it. The chapter on related units covers them.
- Controlling uses a controlling area for internal cost accounting.
This explains an important design idea. The plant is the link between logistics and finance. When a goods receipt is posted to a plant, SAP finds the company code through the plant's assignment and creates the accounting document in that company code. The warehouse clerk never enters a company code, because the plant implies it.
How organisational units appear in data
Organisational units become key fields in tables. Understanding this makes the model concrete.
- Almost every application table starts with a client field,
MANDT. Together with the rest of the key, it keeps one client's data separate from another's. - Plant-level data carries
WERKSin its key. For example, a material's planning parameters are stored once per material and plant. - Stock quantities carry
WERKSandLGORT(the storage location) in the key, so they are held per material, plant, and storage location. - Accounting documents carry the company code,
BUKRS, in their key.
So the level of an organisational unit tells you the grain of the data. If a value should differ by plant, it goes in a plant-level table. If it should be the same everywhere, it goes at client level. The chapter on material data levels covers this in detail.
A first look in Open SQL
The following ABAP report reads plants and shows which company code each belongs to. It joins the plant table T001W to the valuation area table T001K. Here BWKEY is the valuation area. In most systems it equals the plant, so it links a plant to a company code.
REPORT z_plant_company_codes.
SELECT w~werks,
w~name1,
k~bukrs
FROM t001w AS w
INNER JOIN t001k AS k ON k~bwkey = w~bwkey
INTO TABLE @DATA(lt_plants)
UP TO 20 ROWS.
cl_demo_output=>display( lt_plants ).Points to notice:
- The query does not mention the client. Open SQL adds the filter on the logon client automatically, so you only ever see the current client's plants. This is client separation at work.
- The join does not use a column named "company code" on the plant. The plant reaches its company code through the valuation area. The chapters on plant assignment and the valuation area explain why.
UP TO 20 ROWSlimits the result. It is a practical habit when exploring unfamiliar tables.
Common errors in the working model
These mistakes appear often when people first learn the structure.
- Treating the plant as a physical building. A plant is a logical unit for planning and valuation. One factory may be several plants, and one plant may cover several buildings. Design it from the business need, not from the site map.
- Treating the company code as a department or cost centre. A company code is a legal accounting entity. Internal reporting units belong elsewhere, such as the controlling area.
- Assuming a storage location key is globally unique. Location
0001can exist in many plants. Always read it together with the plant. - Mixing up levels when reading stock. Stock is held per material, plant, and storage location. Summing storage locations gives plant stock, but adding plants together without regard to company code mixes legal entities.
- Expecting to move a plant between company codes freely. The assignment is fixed once the plant has stock or accounting history. Changing it later is a major, risky project.
- Working in the wrong client. The same plant number can exist in a development client and a test client with different data. Always check which client you are logged on to.
Why this matters for the rest of the tutorial
Every later topic builds on this model. The assignment rules, the way material master data is split into levels, the database tables, and the customizing steps all follow from the idea that data belongs at a specific organisational level. If you can state at which level a requirement lives, you can usually predict where SAP stores the data and how it behaves.
Exercise
A company has one legal entity with two factories. Each factory has a raw materials warehouse and a finished goods warehouse. Which units would you create (client, company code, plants, storage locations), and how many of each?
Show answer
One client, because there is a single system landscape for the enterprise. One company code, because there is one legal entity. Two plants, one per factory, both assigned to that company code. Four storage locations: a raw materials location and a finished goods location in each plant. The two raw materials locations can share the same key, such as 0001, because a storage location is unique only within its plant.
Exercise
A goods receipt is posted for plant 1000. The user does not type a company code, yet SAP creates the accounting document in company code 1000. How does SAP know which company code to use?
Show answer
Each plant is assigned to exactly one company code, through its valuation area. SAP reads that assignment from the plant, here through tables such as T001W and T001K, and creates the accounting document in the company code it finds. The user only needs to supply the plant.
Exercise
Why does the Open SQL query in this chapter not include a condition on the client, and what would happen if two clients in the same system held different plants?
Show answer
Open SQL automatically restricts a query to the client you are logged on to, so the client field is handled for you. If two clients held different plants, each user would see only the plants of their own logon client, because the data of the two clients is kept apart.