Revisiting ABAP RESTful Programming Model (RAP)

Objective

After completing this lesson, you will be able to recap the ABAP RESTful Programming Model (RAP)

RESTful Programming Quick Review

The ABAP RESTful Application Programming Model (RAP) defines the architecture for efficient end-to-end development of intrinsically SAP HANA-optimized OData services (such as Fiori apps). It supports the development of all types of Fiori applications as well as publishing Web APIs. It is based on technologies and frameworks such as Core Data Services (CDS) for defining semantically rich data models and a service model infrastructure for creating OData services with bindings to an OData protocol and ABAP-based application services for custom logic and SAPUI5-based user interfaces, as shown in the figure below. 

When developing applications in the ABAP environment, it enables you to expose: 

  • OData Services via Business Services Provisioning using ABAP RESTful Application Programming Model. 
  • HTTP services using HTTP service editor. You can use HTTP service editor to create and activate an HTTP service based on the ABAP Internet Communication Framework (ICF). 

RAP enables the user experience and innovates business processes in ABAP-based SAP solutions by leveraging SAP Fiori, SAP HANA, and the cloud. It is a long-term strategic solution for ABAP development on SAP’s flagship product SAP S/4HANA, cloud and on-premise (as of release 1909) editions, as well as on SAP BTP ABAP Environment.

SAP uses RAP to build new standard applications and modernize existing ones and recommends that its customers and partners use RAP for their custom developments as well.

RAP offers a standardized development flow in the modern, Eclipse-based ABAP Development Tools (ADT), and a rich feature set for building applications from different domains, such as transactional and analytical apps, either from scratch or by reusing existing custom code. Built-in capabilities such as ABAP unit tests, the ABAP cross trace tool, and knowledge transfer documents are offered along the RAP development stack to cover core software quality concepts such as testability, supportability and documentability.

Different types of services can be built with RAP:

  • OData-based services for building delightful, role-based, responsive, and draft-enabled SAP Fiori apps.

  • OData-based services for exposure as Web APIs.

  • InA-based, analytical services for building stories in SAP Analytics Cloud.

  • Services for the SQL-based access to ABAP-managed data from ODBC-based clients.

RAP offers two main technical runtime implementation types. Watch the following video to learn about them.

Cloud-Optimized ABAP Language

ABAP is a programming language highly optimized for business applications, both at the small and at the large scale. Together with ABAP SQL as query language for database access it is designed to master the total costs of development for business applications. As such, the ABAP language has evolved over a long time from procedural and dynamic programming up to ABAP objects. Thereby, both its capabilities and the number of ABAP keywords increased steadily, allowing for enormous flexibility but leading to complexity at the same time.

Now, for the Cloud Extensibility Model, the scope of ABAP language commands has been refined to simplify and standardize ABAP development and enable cloud-ready programming. In the new ABAP Language Version "ABAP for Cloud Development", only modern ABAP statements and concepts, with a focus on cloud-enabled, object-oriented design and modern programming models are allowed. Unallowed statements result in syntax errors. Likewise, access to the file system, profile parameters or ABAP server operations is not allowed in the cloud. An overview of programming concepts is shown in table below and serves as a (non-comprehensive) list of criteria to decide whether APIs can be released or not.

Concepts in Cloud Development

Not Used in Cloud Development Used in Cloud Development 
Direct table access Access via CDS 
BAPIs Access via RAP facades 
BOPF, BOR RAP Business Objects (BO) 
Classic programming models like SAP GUI/Dynpro, Webdynpro, BSP Fiori UIs 
Customer Functions, Enhancement Frameworks BAdIs 

While in general ABAP SQL and CDS must be used to access the database from the ABAP server in your extensions, ABAP Managed Database Procedures (AMDP) are enabled to work with the underlying SAP HANA database directly to further strengthen code-pushdown to the database

With Developer Extensibility, you can create a RAP Business Object (BO) that can be used to create a custom:

  • Data Model

  • Behavior definition and implementation

  • Service definition and Service binding

Congratulations! You have done the quick recap of the RAP, and also what is new with respect to cloud-optimized ABAP language.

Log in to track your progress & complete quizzes