Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 3.82 KB

abap_rap.md

File metadata and controls

52 lines (38 loc) · 3.82 KB

The ABAP RESTful Application Programming Model

ABAP is a proprietary programming language developed by SAP SE. Its first release dates back to 1983 with the SAP R/2 system. Consequently, the ABAP programming language and the corresponding programming models changed significantly during this time. This section introduces the latest programming model for the ABAP language: the ABAP RESTful Application Programming Model (RAP).

The goal of RAP is to provide a programming model to enable the creation of OData services. These OData services can be used to implement SAP Fiori applications or to provide Web APIs. RAP consists of the components shown in the following image:

ABAP RAP Components

The data model of the application is the basis of RAP. The data model is created using the Core Data Services (CDS). According to the SAP Help CDS

... provides an infrastructure for defining and consuming semantically rich data models in SAP HANA.

In particular, ABAP CDS provides a framework for defining and consuming semantic data models on the central database of the application server.

On the basis of the data model, Business Objects and Queries are created. Business Object is a term used to represent any real-world object. In the context of an enterprise application, this could, for example, be a customer or a sales order. Usually, these Business Objects have a structure and behaviour. Consider a sales order in SAP S/4HANA as an example. The sales order consists of a header and several items. The header contains general data like the sold-to party or an overall status. The items contain, for example, the ordered products, the ordered quantities and the price. Furthermore, the sales order is related to other business objects. The product or the sold-to party are business objects themselves. Both, a hierarchical structure and relations to other Business Objects, are common qualities of Business Objects. Therefore, RAP provides concepts for modeling the structure and the relations of Business Objects.

Besides the structure, a Business Object also has a behaviour. The behaviour defines which operations are possible for a business object. A sales order could, for example, be created. After its creation, it might be changed until it is released. Once it is released, it is only possible to cancel the whole sales order or create a delivery for the sales order. RAP also provides functionality for modeling and implementing the behaviour of Business Objects.

In contrast to the Business Object, a Query provides read-only access to the underlying data model. This access is used for the creation of analytical reports.

Based on the Business Objects and Queries Business Services can be provided. RAP enables the separation of the definition of a service (i.e. which parts of a Business Object are exposed) and the Binding of a service to a particular protocol (i.e. ODate V2 or OData V4). Business Services are used by different consumers. A consumer of a Business Service could be an SAP Fiori App to enable users to work with the Business Object. For example, in SAP S/4HANA the SAP Fiori App Manage Sales Orders allows users to create and monitor sales orders.

See ABAP RESTful Application Programming Model on the SAP Help Portal for details on the different aspects of RAP mentioned above.

Exercise 1

Think of the product ratings customers can provide on e-commerce Web sites. What Business Objects can be identified? What is the structure of these Business Objects and what is their behaviour?


< Previous Chapter | Next Chapter > | Overview 🏠