Sub topic 4
Master data shared across modules
This chapter assumes you know what an ERP system is and understand basic relational database ideas such as tables, keys, and joins. It also assumes you have read the chapter on organizational structure, because master data is always created against organizational units such as company codes and plants.
What master data is
Master data describes the long-lived business objects that many transactions refer to. A customer, a supplier, a product, a G/L account, and a cost center are all master data. Transaction data is what happens to those objects: a sales order, a goods receipt, a journal entry.
The distinction matters for three reasons.
- Master data changes rarely. A material is created once and used in thousands of documents.
- Master data is shared. Procurement, Sales, Inventory, Manufacturing, and Finance all read the same material record.
- Master data controls behavior. Fields on the record decide how a document is processed, for example which G/L account is posted or which payment terms apply.
A document copies some master data values when it is created. Later changes to the master record do not rewrite old documents. This is why wrong master data causes errors that are hard to correct afterwards.
The core master data objects
| Object | Main users | What it holds |
|---|---|---|
| Business partner | Sales, Procurement, Finance | Customers and suppliers: names, addresses, roles, payment data |
| Material (product) | Procurement, Sales, Inventory, Manufacturing | What is bought, stored, produced, or sold |
| G/L account | Finance | Accounts in the chart of accounts |
| Cost center and other controlling objects | Controlling | Where costs are collected |
| Bill of material and routing | Manufacturing | Components and operations needed to make a product |
| Pricing and purchasing conditions | Sales, Procurement | Prices, discounts, surcharges |
The business partner has its own chapter. This chapter concentrates on the material, because it shows most clearly how one object serves many modules.
The material master and its views
A material is not stored as one flat record. It is split into views, and each view belongs to one functional area. Each view is maintained at a specific organizational level.
| View | Organizational level | Typical content |
|---|---|---|
| Basic data | Client | Material number, description, base unit of measure, weight |
| Sales | Sales organization and distribution channel | Delivery plant, tax data, pricing groups |
| Purchasing | Plant | Purchasing group, order unit, planned delivery time |
| MRP | Plant | Planning method, lot size, safety stock |
| Storage | Plant and storage location | Storage conditions, batch handling |
| Accounting | Plant (valuation area) | Valuation class, price control, standard or moving average price |
This layout explains why the same material can behave differently in different plants. The basic data is global, but the planning method, the purchasing data, and the valuation are set per plant. A product can be made in plant 1010 and only bought in plant 2010.
In S/4HANA the material master transaction (MM01) is still available, and SAP also provides Fiori apps for managing products. The underlying tables are the same. The general data is in MARA, the plant data is in MARC, the storage location data is in MARD, and the valuation data is in MBEW. In S/4HANA the material number field was extended to 40 characters, which matters when you build interfaces that assumed 18.
The material type and the accounting link
Every material has a material type, such as raw material, finished product, trading goods, or service. The material type decides which views the material may have. For example, a service has no storage data, and a trading good is normally not planned for production.
The accounting view is the link between logistics and Finance. Its valuation class, combined with the movement type of a stock posting, determines the G/L account that is posted automatically. A goods receipt for a raw material does not ask the user for an account. The system finds it from master data and configuration.
Goods receipt for purchase order
Material master (valuation class) + movement type 101
-> account determination
-> debit: inventory account
-> credit: goods receipt / invoice receipt clearing accountThis is the mechanism behind the statement that Inventory and Finance are integrated. Nobody copies data between modules. Both read the same material record, and rules in configuration pick the accounts.
Reading master data in the database
Because master data lives in ordinary tables, you can inspect it with Open SQL. The following ABAP query lists materials with their plant-level data. It joins the general table with the plant table.
SELECT FROM mara
INNER JOIN marc ON marc~matnr = mara~matnr
FIELDS mara~matnr, mara~mtart, marc~werks, marc~dismm
WHERE marc~werks = '1010'
INTO TABLE @DATA(plant_materials)
UP TO 100 ROWS.The fields are: matnr (material number), mtart (material type), werks (plant), and dismm (MRP type). One row in MARA can match several rows in MARC, one per plant where the material is extended. If you count rows from this join without restricting the plant, you count material-plant combinations, not materials.
Creating and extending master data
Creating a material and extending it are different steps.
- Creating a material makes the general record, including the basic data view.
- Extending the material to a plant, sales organization, or storage location adds the organizational-level views.
A material that exists but is not extended to a plant cannot be used in that plant. A typical error when posting a purchase order is that the material is not maintained in the plant. The fix is to extend the master record, not to change the order.
Customer and supplier data follows the same pattern. A business partner has a general part plus roles and organizational data, such as the company code data used by Finance and the sales area data used by Sales.
Common errors and edge cases
- Missing extension. The material exists but lacks the purchasing, MRP, or accounting view for the plant. Documents fail with "not maintained" messages.
- Wrong valuation class. The posting succeeds but lands on the wrong G/L account. Correcting this after stock exists requires a controlled change, because stock value is already posted.
- Price control. Standard price and moving average price give different valuation behavior. Changing the price control on a material with stock has accounting consequences.
- Changed base unit. The base unit of measure is difficult to change once stock or documents exist. Choose it carefully.
- Duplicates. Two business partners or materials for the same real-world object split the history across records and break reporting.
- Interfaces with short fields. Older interfaces that assume an 18-character material number can truncate the 40-character number.
Governance
Master data quality is mostly an organizational problem. Mature projects define who may create and change each object, use approval workflows for sensitive fields such as payment terms, and check for duplicates at creation time. Change documents record who changed which field and when, which supports audits.
Summary
Master data is the shared foundation under every module. A material record is divided into views that are each tied to an organizational level, so one product can be sold in one sales organization, planned in one plant, and valued in another. The accounting view links physical stock to the G/L, which is how logistics postings create financial postings without manual entry.
Exercise
A purchase order for material M-100 in plant 2010 fails with the message that the material is not maintained in the plant. The material is already used in plant 1010. What is the cause and what is the correct fix?
Show answer
The material master exists with basic data and views for plant 1010, but it has not been extended to plant 2010. Plant-level views such as purchasing, MRP, and accounting are maintained per plant. The fix is to extend the material to plant 2010 and maintain those views. The purchase order does not need to change.
Exercise
Why does a goods receipt for a raw material post to an inventory account without the user entering any account?
Show answer
The accounting view of the material master holds a valuation class. Together with the movement type of the goods receipt, the valuation class feeds automatic account determination in configuration, which selects the inventory account and the clearing account.
Exercise
A query joins MARA to MARC without a filter on plant and returns 5,000 rows. Can you conclude that there are 5,000 materials?
Show answer
No. MARC holds one row per material and plant, so the result counts material-plant combinations. To count materials, count distinct MATNR values.