This is a test message to test the length of the message box.
Login
ABAP RAP Introduction
Created by Software-Heroes

RAP - Introduction

583

The ABAP RESTful Programming Model will be the programming model of the future in the ABAP area, in this article we will look at the meaning, use and structure.

Some will ask: Why was another programming model developed? Others will ask: programming model? But the answer is very easy, the technology for the frontend has changed and developers, in contrast to the past, have to model data in the backend and make it available to the frontend via a service. The classic ABAP development has changed a lot and so have the requirements for a backend developer.

 

RAP

The ABAP RESTful Programming Model, or RAP for short, is one of the two programming models that was created with the Business Technology Platform (BTP). The other is the Cloud Application Programming model, CAP for short, and is based on NodeJS or Java. In this series, however, we will focus on RAP and thus remain true to ABAP.

RAP is now the third programming model when you look at ABAP development. In addition, the following graphic, which puts the three models side by side and shows the development well:

© 2022 SAP SE

 

The first model (1) was based on freestyle development with dynpros and classic via PBO/PAI. Everything that the GUI construction kit offered and made available to the ABAP developer was possible here. The second model was the ABAP Programming Model for SAP Fiori (2) with the first Fiori applications supplied via the OData service. The SEGW transaction plays a central role in providing the service and the majority of the development takes place in the classic development tools. RAP (3) is the latest programming model, based primarily on Core Data Services.

 

Requirements

Although RAP is a cloud programming model, it has now also arrived in S/4 HANA for on-premises, since the versions share the same core. The following overview of the releases:

  • Release 1808 - First release in the cloud (ABAP Environment)
  • Release 1909 - On-premise release without validations, determinations and only as unmanaged
  • Release 2009 - Managed and Unmanged On-Premise available, now fully usable
  • Release 2109 - Recommendation to only use RAP as a programming model on on-premises

 

From the 2009 release it can now be fully used and learned with. From this release you can already start implementing applications, smaller functions such as draft or late numbering are still missing.

 

Structure

How is RAP structured and how is such a new business object assembled? First of all, the following overview picture with the individual layers. You should note that the model is always based on database tables.

© 2022 SAP SE

 

On the bottom layer is the data model and the modeling of the relationships among each other. Core data services are created here that model the object and a behavior definition to implement additional functions.

The middle layer models the object for external use, the so-called projection. This defines the functionality for the application or API, it can limit the functionality but not add new functionality. The protocol in the service binding is also defined on this layer.

The last layer describes the scope for using the services.

 

Managed vs Unmanaged

We already mentioned the managed and unmanaged approaches above, what is that all about? This is primarily about migration scenarios that you want to map as a brownfield. If you still have existing encapsulated objects that take care of managing the data, then you can reuse them in an unmanaged object and don't have to develop everything from scratch. If you rely on Greenfield and have to redo everything anyway, then definitely use the managed approach.

© 2022 SAP SE

 

With most new developments, you will always rely on the managed approach, since the entire administration of the object is taken over for you here.

 

Scope

What is in a business object and how can you use it? Here is a list of functions that you have available within an object:

  • Validation - Checking of fields and states of the data. Error messages can prevent saving so that no inconsistent state is saved.
  • Determination - Enrichment of the data and fields via rules, external APIs or existing information.
  • Action - Triggering an action in the context of the business object in order to process data consistently or to implement status.
  • Draft - Caching the data without changing the productive data. If the data is consistent at the end, the productive data is updated.

 

What can you do with a RAP object and what can you use it for?

  • OData for an application (with annotations)
  • OData as API
  • Data integration
  • Replacement for BAPI

 

We will explain the individual categories, functions and topics to you in the following articles so that you get a clear idea of what you can do.

 

BOPF

If you have looked at the scope and content of RAP and already know BOPF, then you will see many parallels to it. BOPF already represented a business object and combines tables into a logical unit. Also with BOPF there are validations, determinations and actions on the object, this concept was adopted for RAP, but reduced by the boilerplate code and the framework.

 

Conclusion

RAP will play a very important part in ABAP development in the future and should already be a have-to-learn for every ABAP developer who still has a few years to go. If you don't currently have a system to learn it, we recommend the free version via BTP, a sandbox system with Foundation Stack (no costs except hardware) or the Developer Edition for private computers.


Included topics:
RAPBTPIntroduction
Comments (0)



And further ...

Are you satisfied with the content of the article? We post new content in the ABAP area every Friday and irregularly in all other areas. Take a look at our tools and apps, we provide them free of charge.


RAP - Deep Action in OData v4

Category - ABAP

In this article we will look at actions with deep structures, how we can create them and pass data to an API endpoint.

05/24/2024

BTP - Connect On-Premise (Consumption Model v2)

Category - ABAP

In this article we want to provide another update on the connection of on-premise systems and how this is done with a communication arrangement.

12/15/2023

RAP - Show app count (Tile)

Category - ABAP

This example is about displaying a counter on the tile of a Fiori Elements application and how such a thing can be implemented.

10/06/2023

RAP - Generator (Fiori)

Category - ABAP

In this article we will look at the more complex RAP generator as a Fiori Elements application and what advantages you have with it.

09/15/2023

RAP - Generator (ADT)

Category - ABAP

Today, let's take a look at the RAP Generator, which is already integrated into ABAP Development Tools, and how you can use it to easily build new RAP apps.

09/08/2023