Welcome to the first part of our five-part blog series where we will elucidate and emphasize on ABAP RAP. By the end of this blog series, you will get a deep understanding of different programming models in ABAP, various topics in RAP like its layers, architecture, CDS, etc. and you will be able to create different projects/scenarios using RAP. We will also look at a hands-on scenario using RAP that demonstrates the end-to-end capabilities of the same.
First, we will talk about the different programming models of ABAP and then move forward with our topic for the series.
Below are some pre-requisites that will help you throughout the blog series. If you do not know these topics already, you can go through the introduction blogs to avoid situations like:
- Hands-on experience with ABAP
- A brief experience with TCODE’s like SE80, SE38.
- A brief knowledge of OData
- Some knowledge of CDS will help in the hands-on.
Note that it is by no means necessary for you to have a thorough knowledge of the aforementioned topics, just a basic idea will suffice.
As you have already read, to create the future, you need to know and learn the past, therefore, before diving deep into the topic, let’s look at the history of different programming models that led to the development of RAP.
Evolution of different ABAP programming models
Classic/ Traditional ABAP programming model
The Traditional ABAP programming model was developed with the ABAP release prior to 7.5. In this model, the applications and developments are made using ABAP GUI like reports, module pools, transaction codes like SE38 and SE80, etc. The traditional programming model is designed for complete server-side processing on the ABAP application server. It is an on-premise model which is capable of creating ABAP GUI and web-dynpro applications, providing significant value to customers.
With the introduction of Core Data Services, SAP HANA for ABAP was able to utilize the development capabilities and data modeling infrastructure. CDS views are virtual data models of SAP HANA which allow access to tables of the HANA database. Data models based on CDS are semantically rich and can be used for all application domains. But since CDS views are read-only, transactional services could not be performed. Also, the onus of implementing OData services was on developers. For overcoming these shortcomings another model which allowed ABAP developers to build Fiori applications was introduced.
ABAP Programming model for SAP Fiori
The essential characteristic of this model is that it reduces coding complexity to expose CDS view as an OData service to the gateway by performing a so-called auto-exposure process. The ABAP programming model for SAP Fiori is available with the release 7.5 and above of SAP NetWeaver AS for ABAP. This model is based on modern technologies like CDS, BOPF( Business Object Processing Framework), and SAP Gateway services using SEGW to expose a CDS data model as an OData service. Also, the SAP Fiori model enables ABAP developers to create Fiori applications using just ABAP.
ABAP RESTful Programming Model
ABAP RAP specifies an architecture for developing SAP HANA-optimized OData services from start to finish. It enables the creation of a wide range of Fiori applications and publishing APIs.
This model uses CDS for defining data models, ABAP-based application services for custom logic, and interfaces based on SAPUI5. SAP Fiori application consumes the logic defined by data model and behavior, and expresses, and exposes as business services. Without further ado, let’s have a look at the main layers of ABAP RAP:
- Data Modelling and Behavior
Data models for CDS are defined in this layer. They contain CDS entities based on dictionary tables and more, which are represented as CDS views in ABAP. CDS views consist of fields and associations to other CDS views forming a semantic network.
The data modeling and behavior layer also enables you to run queries for structured data retrieval. There are three ways to implement behaviors:
- Managed scenario: In a managed scenario, the RAP framework implements the behavioral elements while the complex logic can be added using ABAP. It is like BOPF where we define which tables have to be updated by the end of the process. It is available only on SAP HANA cloud.
- Managed with save scenario: In this scenario, the tables are not updated directly with the data. Instead BAPIs, or update function modules can be called to save the data. Currently it is available for SAP internal purpose only.
- Un-managed scenario: In an unmanaged scenario, all the coding implementation is done by you and is used if you have an existing BOPF application or ABAP code that would be called when the business object is saved.
- Business Service Provisioning
As you can see from the diagram, business service provisioning layer acts as an intermediate between data model and consumer of data. This layer allows you to control definition of business services like allow different behaviors to different users. These business services are used through service definition and service binding.
- Service Consumption
The service consumption layer consumes all the services that are exposed on the business provisioning layer. To process and perform analytics, it gets data from the previous layer. In simpler words, SAP Fiori interacts with service provisioning layer and supports the OData module to display the information contained there.
ABAP RAP (Restful Application programming) describes the architecture to build an end-to-end enterprise ready, intrinsically rich SAP HANA-optimized, OData based Fiori UI service and Web APIs in the cloud as well as on-premise in an efficient way. Being an evolutionary successor to the ABAP Programming model for SAP Fiori, RAP fills in the gaps and inherits the best of the model.
Things like ABAP development tools in eclipse, use of language like ABAP and CDS and powerful framework makes RAP future ready.
Getting ready for upcoming blog series-
- As we will be using the ABAP on Cloud environment along with Eclipse IDE for upcoming blog series, it would be great to already set things. Please follow the link for the setup guide.
- If you are not familiar with the ABAP on Cloud development environment, then follow the guide to write your first classical Hello World console application in Eclipse ADT(ABAP Development Tool).
- CDS plays an important role for learning ABAP RAP and so you should be aware of how to use it. Here is a blog which can help you with the same.
That’s it for now, we will continue on our journey towards ABAP RAP in upcoming blogs. We will work on a hands-on scenario where there will be a hire-to-retire scene consisting of the HR and HR Manager having different permissions for the mentioned task. It will give you in-depth knowledge on the different layers and components of RAP. Till then, goodbye and happy learning!!