SAP Plant Table and SAP Company Code Table with useful ABAP Tips

SAP Plant Table e1478774081806

List of main SAP Plant Table and SAP Company Code Table.

List of the important Plant and Company Code Tables in SAP and the relationship between plant and company code.

SAP Company Code Tables

SAP Company Code Overview

“Company is the top most organizational unit after client which incorporates individual financial accounting statements of several company codes. A company can have many company codes.

In SAP, it is optional to create company. Following steps will take you through the procedure of creating company.”*

Use the following path to Create Company in SPRO:

IMG ⇾ Enterprise Structure ⇾ Definition ⇾ Financial Accounting ⇾ Define Company

Or try directly the SAP TCode: OX15

SAP Company Code Tables

The only table to remember for SAP Company Code is T001.

The field for Company code in SAP is: BUKRS typed BUKRS

SAP Plant Table

SAP Plant Overview

Let’s start with a short definition of Plant in SAP.

“Plant is an organizational unit within a company where activities take place. A plant will produce goods and makes goods available for the company.”*

In SPRO, the path to create Plant:

IMG ⇾ Enterprise Structure ⇾ Definition ⇾ Logistic General ⇾ Define, Copy, Delete check plant

Or use the SAP Tcode: OX10

Read also List of Important SAP SD Tables (Sales and Distribution).

Main SAP Plant Tables

The main tables for Plant in SAP are:

SAP Plant TablesDescription
T001W Plants/branches
T001L Storage Locations
T024E Purchasing Organizations
T024W Valid Purchasing Organizations for Plant
T001 Company Codes

The Field for SAP Plant is WERKS (typed as WERKS_D).

Plant & Company Code Tips

Retrieve Plant from Company Code in SAP

In order to retrieve the plant based on company code, try this join query :

SELECT K~BUKRS INTO LV_BUKRS 
 FROM T001K AS K 
 INNER JOIN T001W AS W 
   ON K~BWKEY = W~BWKEY 
 WHERE W~WERKS = P_WERKS.

You can also check the standard view V_T001K_ASSIGN, you will have the company code and plant assignment table

Get Address of a Company Code Tables Join

In order to Get the Address of a company Code, join ADRC and T001.

ADRC with ADDRNUMBER = T001-ADRNR

Link between BUKRS (Company code) and VKORG (Sales organization)

If you want to find the link between Company Code and Sales Organization, use the following query in ABAP

SELECT VKORG BUKRS 
 FROM TVKO 
 INTO TABLE LT_TVKO 
 WHERE VKORG = P_VKORG
 AND   BURKS = P_BUKRS.

The SAP table to consider here is TVKO for Organizational Unit: Sales Organizations

*source: SAP MM – Defining Organizational Structure