Skip to Content
Technical Articles

Looking At The ABAP RESTful Programming Model

The ABAP RESTful Programming Model, also known as RAP, is a new paradigm for coding within SAP. The goal of the RAP programming system was to allow for powerful SAP Fiori integration with SAP HANA, allowing for apps to run both on the cloud and on-premise. The RAP model consists of three layers:

1.   Data Modeling And Behavior

The Core Data Services (CDS) module forms a significant part of how ABAP handles SAP HANA data. The CDS models used with the RAP model are expressed in the data modeling and behavior layer. RAP navigates through the data structures through associations. These associations allow the app to retrieve data for use with SAP Fiori. You can execute queries for ad hoc analytics or structured data retrieval within the data modeling and behavior layer. These behaviors can be implemented either as managed or unmanaged. The RAP system itself is responsible for managed orders. With unmanaged behaviors, you’re accountable for the entire system and its interactions.

2.   Business Services Provisioning Layer

The business services provisioning layer acts as an intermediary between the data structures and the front-end systems that use it (SAP Fiori, for instance). While you CAN use your entire dataset for an ABAP program or application, it’s more efficient to create a subset of data. You may also need to allow access to certain behaviors but not allow the user to modify them at a fundamental level (create/destroy records). This layer provides that control through the definition of business services. These business services are constructed of a service binding and service definition that is applicable to native DSP. You’ll have to define a data model subset, as well as a behavior model related to the service you intend to expose. You can then bind that data model to OData protocol versions (v2 or v4 in most cases) and test-drive the result in a browser.

3.   Service Consumption Layer

When we expose services in the provisioning layer, something needs to use that data. The structures in the service consumption layer do just that, using that data revealed by the previous layer to process and perform analytics. The ideal data flow model would see an SAP Fiori app interacting with the services provisioning layer and leveraging the OData module to display the information contained therein.

The Process of Developing With RAP

The developmental flow with RAP starts with the CDS model. From the model, you can add behaviors and develop an implementation lass which contains your code. Next, the coder specifies what they’ll use for the data model projection and behavior projection. The last step is to expose the service definition, then bind it and finally publish it. Once you complete those steps, you can use a browser to test it and see that it works. RAP development doesn’t have to be complicated, but it can take some time to get used to the RESTful model. Breaking it down into its component parts makes it easier to grasp what goes where. From a programmer’s perspective, knowing how the system interfaces can guide you to figure out how they solve problems.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.