✒️ABAP Las BAPIS
ABAP Las BAPIS
What are BAPIs?
BAPI stands for Business Application Programming Interfaces. They are standardized methods that allow us to perform actions on SAP business objects, such as creating an order, creating equipment, or making a goods movement, among many others.
They serve as the standard interfaces of SAP, specifically referring to pieces of code in the form of function modules used in the integration between SAP components and external components.
All processes previously carried out using Batch Input can now be done through the execution of BAPIs.
All BAPIs share certain characteristics:
- They are methods of a SAP business object.
- All are defined as RFC (Remote Function Call) function modules.
- They avoid dialog windows during processing.
Business objects are similar to classes in object-oriented programming, consisting of attributes, methods, events, and key fields for a specific business application or scenario.
Business objects can be viewed in a repository (BOR - Business Object Repository) accessible from standard transaction SWO1. Within this repository, you can view the methods of each business object, corresponding to different BAPIs in the system.
BAPIs are standard function modules in the SAP system used to perform updates within the system. They leverage the same validations and database-level updates as if we were using standard SAP system transactions.
RFC function modules are function modules with the capability to access other systems besides the one we are working on, whether it's to retrieve information or to update information.
BAPIs serve various functions:
- Generating reports.
- Creating objects in the SAP system, such as a purchase order request.
- Communicating between SAP systems or between SAP and non-SAP systems.
- Data migration.
Considering this last functionality, BAPIs in SAP represent an alternative to traditional methods like Batch Inputs.
Comparing BAPIs with Batch Inputs, BAPIs offer the following advantages:
- Since BAPIs are generally SAP standards, using BAPIs ensures that the programs we develop will be compatible with future SAP versions. This is not the case with Batch Inputs, as transaction screens often change between SAP versions, leading to Batch Input failures.
BAPIs are generally standard since, although they can be created using transaction SE37 as RFC function modules, rarely do we need to create a new one.
- BAPIs can be used from any development platform that supports the use of RFC function modules.
- Since BAPIs are standards, they use the same validations as those used in standard system SAP transactions. Therefore, using BAPIs is very safe in terms of data integrity and desired results from system execution.
However, like any technology, BAPIs have disadvantages:
- The main challenge lies in finding the right BAPI for what we need to do in the system.
- Another major challenge in using BAPIs lies in correctly loading the values of the input internal tables. That is, it can sometimes be complex to know how to correctly load the input parameters of BAPIs to produce the desired result. To overcome this difficulty, we can research online, looking for examples of their use, especially on the SAP Developer Network (SDN), where we will find a lot of information.
Finally, it is worth mentioning that although all BAPIs are RFC function modules, not all RFC function modules are BAPIs. The main differences between BAPIs and RFC function modules are:
- A BAPI can communicate with another BAPI, while an RFC function module cannot communicate with another RFC function module.
- BAPIs use concepts from object-oriented programming, while RFC function modules use concepts oriented toward procedures or subroutines.
- A BAPI has a fixed interface and functionality unaffected by possible upgrades, while an RFC function module, depending on its status, may undergo changes in interface and operation.
The BAPI Transaction
To view existing BAPIs in the system, we can use the standard BAPI transaction.
Through the standard BAPI transaction called "BAPI Explorer," we can access all existing BAPIs in the SAP system.
Standard BAPIs
There are certain standard BAPIs that can be implemented for most business objects. These BAPIs have specific functions, such as listing existing instances of a SAP business object. They are:
Standard BAPIs for data reading
- GetList(): This BAPI selects a range of objects such as companies or material numbers.
- GetDetail(): It is used to retrieve data from an instance of a business object.
- GetStatus(): It is used to obtain the status of a business object.
- ExistenceCheck(): It checks if a certain entry of a business object exists.
Standard BAPIs for creating or modifying data
- Create() or CreateFromData(): These are used to create instances of business objects.
- Change(): It is used to modify an instance of a business object.
- Delete() and Undelete(): These are used to delete and cancel the deletion of an instance of a business object.
Standard BAPIs for mass processing
BAPIs for creating or modifying data can be used for mass processing, i.e., for processing large amounts of data. To do this, it will be necessary to add the suffix 'Multiple' to the name of the methods. For example: ChangeMultiple(), CreateMultiple(), or DeleteMultiple().
Standard BAPIs for replicating object instances
The BAPIs Replicate() and SaveReplicate() are used to copy object instances from one system to another.
 
 
 
Sobre el autor
Publicación académica de Jaime Eduardo Gomez Arango, en su ámbito de estudios para la Carrera Consultor ABAP.
Jaime Eduardo Gomez Arango
Profesión: Ingeniero de Sistemas y Computación - España - Legajo: SW34C
✒️Autor de: 102 Publicaciones Académicas
🎓Cursando Actualmente: Consultor ABAP Nivel Avanzado
🎓Egresado del módulo:
Disponibilidad Laboral: FullTime
Presentación:
Ingeniero de sistemas y computación con 8 años de experiencia el desarrollo frontend & backend (react/node) y en cloud (aws), actualmente desarrollando habilidades en sap btp, ui5, abap y fiori.
Certificación Académica de Jaime Gomez