Hello Dear folks, If you are looking for BAPI Company Code Details | BAPI for Company Code Details | BAPI Company Code Details Tutorial Step by Step in SAP ABAP | List of BAPIs for Company Code Details | What is the BAPI to Company Code Details then you will get all the details here in this blog post.
BAPI_COMPANYCODE_GETDETAIL
is a standard SAP BAPI used to retrieve detailed information about a company code in the SAP system. It belongs to the FI (Financial Accounting) module and is often used in both custom SAP development and external integrations.
Purpose of BAPI_COMPANYCODE_GETDETAIL
The BAPI is used to:
- Fetch detailed data for a given company code (
BUKRS
) - Display or use company code info in custom reports, applications, or interfaces
- Validate that a company code exists and retrieve additional metadata
- Support integration scenarios, such as external systems needing to display or process SAP company code info
What Data Does It Return?
The BAPI returns details like:
Field | Description |
---|---|
Company name | Long and short names of the company |
Country | Country key of the company code |
City | Location of headquarters |
Currency | Local currency used for transactions |
Language | Communication language |
Fiscal year variant | Controls fiscal period logic |
Address details | Street, postal code, region, etc. |
Basic BAPI Example
DATA: ls_detail TYPE bapi0012_cocode_detail,
lt_return TYPE TABLE OF bapiret2,
ls_return TYPE bapiret2.
CALL FUNCTION 'BAPI_COMPANYCODE_GETDETAIL'
EXPORTING
companycode = '1000'
IMPORTING
companycodedetail = ls_detail
TABLES
return = lt_return.
READ TABLE lt_return INTO ls_return WITH KEY type = 'E'.
IF sy-subrc = 0.
WRITE: 'Error: Company code not found or invalid.'.
ELSE.
WRITE: 'Company Code: ', ls_detail-comp_name,
'Currency: ', ls_detail-currency,
'City: ', ls_detail-city.
ENDIF.
Common Use Cases
Use Case | Description |
---|---|
Master Data Reports | Pull company code info into custom FI reports |
Fiori/UI5 Apps | Display company metadata in custom SAP UI |
Interfaces/Integrations | External systems can fetch company details via RFC or web service |
Validation + Info Retrieval | Combine data checks with descriptive metadata |