Hello Dear folks, If you are looking for BAPI List of Company Codes | BAPI for List of Company Codes | BAPI List of Company Codes Tutorial Step by Step in SAP ABAP | List of BAPIs for List of Company Codes | What is the BAPI to List of Company Codes then you will get all the details here in this blog post.
BAPI_COMPANYCODE_GETLIST
is a standard SAP BAPI used to retrieve a list of all company codes available in the SAP system. It’s part of the FI (Financial Accounting) module and is typically used when you want to present a list of valid company codes for selection, reporting, or integration purposes.
Purpose of BAPI_COMPANYCODE_GETLIST
The primary purpose of this BAPI is to:
- Fetch all company codes configured in the system
- Provide a list for dropdowns, selection screens, or external applications
- Initialize data for reports or batch programs
- Serve as a master data source for integration with third-party systems
What Data Does It Return?
It returns a table of basic company code data:
Field | Description |
---|---|
COMP_CODE | Company Code key (e.g., 1000, 2000) |
COMP_NAME | Company Code name (short description) |
ABAP Example for BAPI_COMPANYCODE_GETLIST
DATA: lt_company_list TYPE TABLE OF bapi0012_companycode_list,
ls_company TYPE bapi0012_companycode_list.
CALL FUNCTION 'BAPI_COMPANYCODE_GETLIST'
TABLES
companycode_list = lt_company_list.
LOOP AT lt_company_list INTO ls_company.
WRITE: / 'Company Code:', ls_company-comp_code,
'Name:', ls_company-comp_name.
ENDLOOP.
Typical Use Cases For BAPI_COMPANYCODE_GETLIST
Use Case | Description |
---|---|
Dropdown lists | Populate company code selectors in SAP GUI, Web Dynpro, or Fiori apps |
Reporting tools | Use as a source for reporting filters or initial selections |
System integration | Supply valid company code options to external systems |
Master data validation | List available company codes for internal consistency checks |
BAPI_COMPANYCODE_GETLIST
is the go-to BAPI for retrieving a list of company codes. It’s simple, fast, and essential when building:
- Selection UIs
- Report filters
- Integration tools
- Data validation features
If you’re working with company codes in any scalable or dynamic context, this BAPI is one of the first tools you’ll want to use.