BAPI- What is it and how its used [Part 1]

BAPI's are basically function modules only. ALL BAPI's are remote enabled function modules which enables to access via non SAP systems.

A remote function enabled FM(Function Module) will be attached to BOR(Business Object Repository) , then only it is termed as BAPI. Using BAPIs you can develop applications without detailed knowledge of the underlying R/3 System.

Each BAPI is having its own business application and area. The integration between R/3 and third-party software, legacy systems, and custom-developed software can be achieved via BAPI.

BAPI explorer with TCODE 'BAPI'.
BAPI explorer
BAPI explorer
All BAPI's are arraigned according to the business area. Details documentation is also available for some BAPI's to show the usage of the BAPI
Documentation of each BAPI
Documentation of each BAPI

BAPI since its RFC enabled FM, has no exceptions. There are BAPI return tables which can be used to analyze the success/failure of the process.

Since BAPI's are basically FM only , we call BAPI the same way we call a normal FM.

Its very important to select appropriate BAPI and also to pass the data in a way required by BAPI. Go through all I/O structures for the BAPI selected to understand this better. We can also call BAPI of other SAP systems. Just mention destination and you are good to go.

     destination 'PW2'
          salesdocument = order
          return        = return
          statusinfo    = statusinfo.

We need to call BAPI_TRANSACTION_COMMIT after each BAPI call to finalize or commit the change or if some error occurs and we have identified the errors we need to use BAPI_TRANSACTION_ROLLBACK to rollback the changes made if any.