Preface – This post is part of the SAP ABAP RAP series.
Table of Contents
THE SAP ABAP RESTful Application Programming model (RAP) supports the efficient end-to-end development of SAP OData based SAP Fiori services and Web APIs intrinsically optimized for SAP HANA on SAP BTP (Business Technology Platform) ABAP environment or on-prem SAP S/4 HANA.
The below rough version of SAP RAP Architecture depicts the major functionalities that we can utilize:
The below figure displays the major artifacts you have to deal with while developing the OData services using the SAP ABAP RESTful Application Programming model. It depicts the bottom-up approach that illustrates the application development flow.
Figure 1: SAP ABAP RAP Architecture Overview
The SAP ABAP RAP is three-layered architecture: Data Modelling and Behaviour; Business Services and; Service Consumption. Let’s see briefly.
Data Modelling and Behaviour
The base layer of RAP is DATA Modelling and Behaviour. Here, we define the business object models, query definitions and their transactional behaviour. Taking an example of a simple SAP Fiori based application, we define the database table and expose the data using CDS. As soon as the CDS for the root entity is created, we define the transactional behaviour also.
In the middle layer, the OData exposer is done in two steps: the first step is where the protocol service scope definition of relevant data entities is defined, and the second step is data binding to the OData model. For example, we have 50 CDS views relevant to Sales-Order but we want only 1 view to be exposed to the outside world. This scenario can be achieved via this layer. (See Figure 2)
Figure 2: Design-time artifacts
The topmost layer is the Service Consumption layer. Here, an OData Service can be exposed as a UI service which can be consumed by SAP Fiori or Web API, that can later be consumed by any client.
Figure 3: Illustration of OData Service consumption by SAP Fiori UI and WEB API