BAPI for Check if Company Code Exists

Hello Dear folks, If you are looking for BAPI Check if Company Code Exists | BAPI for Check if Company Code Exists | BAPI Check if Company Code Exists Tutorial Step by Step in SAP ABAP | List of BAPIs for Check if Company Code Exists | What is the BAPI to Check if Company Code Exists then you will get all the details here in this blog post.

In SAP Financial Accounting (FI), Company Codes are foundational. Almost all financial transactions rely on them, and ensuring a company code exists before processing is crucial—especially when building custom interfaces or automation.

What is BAPI_COMPANYCODE_EXISTENCECHK?

BAPI_COMPANYCODE_EXISTENCECHK is a lightweight validation BAPI that checks whether a given company code exists in the system. It doesn’t return detailed data—it simply tells you if the company code is valid.

This makes it perfect for scenarios like:

  • Input validation in custom programs
  • External system checks via RFC/BAPI calls
  • Pre-validation in workflows or SAP Fiori apps

ABAP Code Example ;

DATA: lv_companycode TYPE bukrs VALUE '1000',
      lv_exist       TYPE bapi_stand-no.

CALL FUNCTION 'BAPI_COMPANYCODE_EXISTENCECHK'
  EXPORTING
    companycode = lv_companycode
  IMPORTING
    exist       = lv_exist.

IF lv_exist = 'X'.
  WRITE: 'Company Code exists.'.
ELSE.
  WRITE: 'Company Code does not exist!'.
ENDIF.

Parameters

ParameterTypeDescription
companycodeBUKRSThe company code to be validated
existBAPI_STAND-NOReturns ‘X’ if it exists, blank otherwise

Leave a Comment