Sub topic 4
The company: grouping company codes for consolidation
This chapter covers the company, the organisational unit above the company code. It assumes you know what a client and a company code are from earlier chapters. It also assumes you can read a simple Open SQL SELECT with a join. The company is small to configure, but it affects consolidation and intercompany reporting, so a mistake there is costly to fix later.
What a company is
A company in SAP Financial Accounting is a group of one or more company codes. It exists so that the system can treat several legal accounting entities as one reporting unit. The usual purpose is consolidation: producing combined financial statements for a group of entities.
Three points define it:
- A company has a six-character ID, such as
GRP001. This ID is separate from any company code ID. - A company has no ledgers of its own. Postings always happen in a company code, never directly against a company.
- A company is optional. A company code can exist without being assigned to any company, and many small systems never define one.
The word "company" is easy to misread. In everyday speech it means a legal business. In SAP that role belongs to the company code. The SAP company is a grouping above it, and it is not necessarily a legal entity.
Where it sits in the hierarchy
The company sits between the client and the company codes. Many company codes can share one company, but each company code points to at most one company. Plants then attach to company codes, as covered earlier.
The diagram shows two rules:
- Assignment from company code to company is many-to-one. Company codes 1000 and 2000 both belong to
GRP001. - A company code cannot belong to two companies at once.
Because the company is defined inside a client, it is also client-specific. Two clients in the same system can define the same company ID with different meanings. Consolidation in one client cannot see data held in another.
Why consolidation needs the company
Each company code keeps its own books, in its own local currency, with its own balance sheet and profit and loss statement. Group reporting needs these books combined. Before that can happen, the system must know which company codes belong together. The company provides that link.
A company in practice does two jobs.
Defining the consolidation scope
A consolidation or group reporting tool can read the company assignment of each company code. It can then collect the figures of all company codes in a company. The exact tool depends on your release and licence. Examples are legacy consolidation components and group reporting. The shared mechanism is that the company ID in the company code record identifies the group.
Identifying the trading partner
The second job is the one most people meet first. When one company code sells to or buys from another within the same group, the transaction is intercompany. For consolidation, both sides must be matched and eliminated. SAP uses the company ID as the trading partner ID for this.
You maintain it in two places:
- The company code record carries the company ID.
- Customer and vendor master records for internal business partners carry that same ID in the Trading Partner field.
When an invoice is posted to such a customer or vendor, the system stores the trading partner on the line item. A consolidation run can then match receivables in one company code against payables in another. If the field is empty on an internal partner, the eliminations can be wrong or require manual work.
Rules for company codes in the same company
Grouping is not free of constraints. According to SAP's documentation, all company codes assigned to one company must share:
- the same operative chart of accounts, and
- the same fiscal year variant (the definition of posting periods).
They may use different local currencies. A company in Germany working in EUR and a company in the UK working in GBP can sit under the same company, and the consolidation tool handles translation.
These rules mean you cannot group arbitrary company codes just because the business wants to report them together. If two company codes use different charts of accounts, they cannot share a company. You would need to align the charts first, or consolidate with a different mechanism.
Where companies are stored
The relevant tables are small.
| Object | Table | Key field | Notes |
|---|---|---|---|
| Company definition | `T880` | `RCOMP` | Name, address, country, language, currency |
| Company code | `T001` | `BUKRS` | Field `RCOMP` holds the assigned company |
You can see the assignment by joining the two tables. The program below lists every company code with its company, if any. It uses a left outer join so company codes without a company still appear.
REPORT z_company_overview.
SELECT c~bukrs,
c~butxt,
c~rcomp,
m~name1
FROM t001 AS c
LEFT OUTER JOIN t880 AS m ON m~rcomp = c~rcomp
ORDER BY c~rcomp, c~bukrs
INTO TABLE @DATA(lt_company_codes).
LOOP AT lt_company_codes ASSIGNING FIELD-SYMBOL(<ls_cc>).
WRITE: / <ls_cc>-bukrs, <ls_cc>-butxt, <ls_cc>-rcomp, <ls_cc>-name1.
ENDLOOP.Open SQL fills the client field automatically, so the query only returns data for the current client. Rows with an empty rcomp column are company codes that belong to no company.
To check which companies are actually in use, count the company codes per company:
REPORT z_company_counts.
SELECT rcomp,
COUNT( * ) AS company_code_count
FROM t001
WHERE rcomp <> ''
GROUP BY rcomp
ORDER BY rcomp
INTO TABLE @DATA(lt_counts).
LOOP AT lt_counts ASSIGNING FIELD-SYMBOL(<ls_count>).
WRITE: / <ls_count>-rcomp, <ls_count>-company_code_count.
ENDLOOP.A company that appears in T880 but not in this result is defined but has no company codes. That is harmless, but it often points to leftover configuration.
Defining and assigning companies
Both steps happen in customizing, not in a business transaction. Use the Implementation Guide (transaction SPRO) or the direct transaction codes.
- Define the company with transaction
OX15. Enter the six-character ID, name, address, country, language, and currency. - Assign company codes to the company with transaction
OX16.
The order matters. The company must exist before you can assign a company code to it. Both settings are client-specific customizing, so they are transported between systems like other customizing entries. A company ID that exists in development but was never transported will block an assignment in the next system.
Edge cases and common mistakes
- Treating the company as a legal entity. Legal reporting, tax numbers, and local statutory accounts belong to the company code. Putting these requirements on the company is a design error.
- Skipping the company until consolidation starts. Adding the assignment late is possible, but then you must also check the trading partner on historic items and master records. Define the company early if group reporting is planned.
- Different charts of accounts in one company. The assignment will be rejected or will cause inconsistent consolidation. Align the charts before grouping.
- Empty trading partner on internal customers and vendors. Postings are made, but intercompany matching fails. The error appears months later, at consolidation time.
- Reusing one company ID for two different groups. The ID is the trading partner key. If two groups share it, the system cannot tell them apart.
- Changing the assignment after postings exist. The system lets you change customizing, but closed periods and earlier consolidation runs used the old grouping. Agree changes with the finance team and test them in a non-production client first.
Decision criteria
Use these questions to decide whether to define a company.
| Question | If yes |
|---|---|
| Will you produce group financial statements from SAP data? | Define a company and assign every group company code to it. |
| Do group entities trade with each other and need eliminations? | Define a company and maintain trading partners on internal customers and vendors. |
| Do all entities share a chart of accounts and fiscal year variant? | They can share one company. |
| Is there only one company code and no group reporting? | The company can stay undefined. |
Exercise
A group has company codes 1000 (EUR) and 2000 (GBP). Both use chart of accounts CAGR and fiscal year variant K4. Can they be assigned to the same company? Name the transaction that defines the company and the one that assigns the company codes.
Show answer
Yes. Company codes in one company may use different currencies, as long as they share the chart of accounts and the fiscal year variant, which they do here. Define the company with OX15 and assign the company codes with OX16.
Exercise
Company code 3000 buys goods from company code 1000. The vendor record for 1000 in company code 3000 has an empty Trading Partner field. What is the consequence at consolidation time, and how do you fix it?
Show answer
The line items carry no trading partner, so the consolidation tool cannot match the payable in 3000 against the receivable in 1000 and cannot eliminate them automatically. Enter the company ID of the company that company code 1000 belongs to in the Trading Partner field of the vendor master record. Postings made before the fix still lack the partner and may need correction.
Exercise
Write what the second query in this chapter returns, and explain why it does not list company codes without a company.
Show answer
It returns one row per company ID found in T001, with the number of company codes assigned to it. The condition WHERE rcomp <> '' excludes company codes whose RCOMP field is empty, so unassigned company codes are not counted.