Modern programming model specifically for the development of business applications in SAP
RAP (ABAP RESTful Application Programming Model) is a programming model from SAP that was developed specifically for mapping business applications in SAP S/4HANA. It enables the creation of end-to-end applications that run on the ABAP stack and are based on principles such as RESTful services and the use of SAP Fiori.
Among other things, RAP is used to develop modern user interfaces with SAP Fiori that offer an improved user experience. RAP is particularly useful for developing applications in the SAP Cloud Platform as it supports cloud-native development paradigms. In addition, RAP requires little to no SAPUI5 experience. Developers who are already proficient in ABAP or CDS views therefore have a simplified entry into the development of Fiori apps. At the same time, with RAP unmanaged, control can be retained and all content can be developed independently. Translated with DeepL.com (free version)
RAP: Advantages and disadvantages
RAP (ABAP RESTful Application Programming Model) is a programming model from SAP that was developed specifically for mapping business applications in SAP S/4HANA. It enables the creation of end-to-end applications that run on the ABAP stack and are based on principles such as RESTful services and the use of SAP Fiori.
Advantages | Disadvantages |
---|---|
RAP offers usability and consistency checks for fields and locks that would have to be developed manually by the developer in SAPUI5 apps. | RAP apps offer the possibility to create list and object pages and therefore have their limits. |
It offers automated CRUD methods for managed RAP apps | Not all controls are available and it is not possible to create custom controls. |
Easy extensibility | Less flexibility |
Simple solution for backend development. | Not all functions are available on all systems (cloud, on-premise) and therefore severely restricts use without offering an alternative. |
By using Core Data Services (CDS) and standardized annotations, developers can create consistent and reusable business logic. | |
Integrated security mechanisms, such as authorization and authentication, that make it easier to develop secure applications. |
RAP uses modern development paradigms such as RESTful services, which enable easier integration and better scalability. By using Core Data Services (CDS) and standardized annotations, RAP enables consistent and reusable data modeling and business logic. It is possible with UI annotations and RAP managed to build an app with simple CRUD methods within a very short time.
RAP offers flexible extension options that allow developers to customize applications to specific business requirements without changing the SAP core.
RAP Unmanaged
In unmanaged scenarios, the methods must be implemented manually, in contrast to managed RAP apps, where some methods are automatically provided by the framework.
The developer is responsible for implementing all the logic, including managing the transaction buffer and memory sequence. This provides more flexibility and control, especially when migrating existing ABAP code and functions.
The structure of mananged and unmanaged apps is basically the same, but there are different options for developers:
Customized logic: in unmanaged RAP, developers write their own custom logic for data retrieval, manipulation and persistence. This provides more flexibility in processing and storing data.
Direct database access: Developers can directly access the database tables and define their own data models using Core Data Services (CDS) views or ABAP classes.
Explicit service definition: Unlike managed RAP, where service definitions are automatically generated based on annotations, unmanaged RAP requires developers to explicitly define service implementations and behaviors
Manual CRUD operations: CRUD (Create, Read, Update, Delete) operations must be explicitly implemented in unmanaged RAP, giving developers complete control over how data is managed.
Integration with existing systems: Unmanaged RAP is often used when integration with existing systems is required or when there is complex business logic that is difficult to implement with the managed approach.
Flexibility: Developers have more freedom to implement complex validation rules, authorization checks and other custom requirements directly in the application logic.
Structure: Some methods are provided by the system so that the functions can be implemented. These are divided into two classes and described below.
- Handler Class: Handles data from the frontend. The methods: Known as interaction methods. These methods pass the transaction buffer data to the saver class for processing.
- CRUD: Create, Read, Update, Delete
- LOCK:
- RBA_<Name>: (Read by Association) Prepares and reads data based on associations.
- CBA_<Name>: (Create by Association) Prepares and creates data based on associations.
- get_instance_authorizations
- Saver Class: Subsequent handling of the data (after calling a method in the handler class)
- Finalize: Performs final calculations on the data model and provides the last opportunity to change data.
- Check_Before_Save: Checks the data consistency and can contain additional validations.
- Save: Saves the transaction buffer data in the database. core/list-item
- Cleanup: Deletes the transaction buffer.
- Cleanup_Finalize: Is only called if errors occur during Check_Before_Save.
Procedure: The sequence through the Saver Class is always the same:
Method sequence in the Saver Class:
- Finalize: Is executed after at least one successful data record has been run through.
- Check_Before_Save: Validates the data before saving.
- Save: Saves the data only if the previous steps were successful.
- Cleanup: Deletes the buffer data.
- Cleanup_Finalize: Optional, wird nur ausgeführt, wenn bei Check_Before_Save Fehler festgestellt wurden.
BOPF and RAP
Through RAP, many possibilities of BOPF were adopted in the behavior definition and thus enable a modularity of apps and a reusability of Fiori applications. RAP unmanged allows these to be controlled individually. This leaves you free to decide whether you want to take the development into your own hands or have the methods automated. RAP offers a comprehensive platform for the development of business applications that were previously supported by BOPF and complements them with modern development practices and tools.
Do you have any questions?
Get in touch with us.