Enabling the Transactional Behavior of an App in SAP RAP

Introduction

This article will provide a step-by-step guide to enable the transactional behaviour of an application in SAP RAP.

  1. Create data model with CDS views
  2. Create Behavior Definition
  3. Add transactional behaviour in Behavior Definition
  4. Create OData service
    1. Create a Service Definition
    2. Expose CDS view
    3. Create Service Binding
    4. Publish OData service
  5. Application preview

Create data model with CDS views

Procedure

  1. Launch ADT (ABAP Development Tool).
  2. Select package for your development.
  3. Right-click on package and choose NEW > Other Repository Objects > Core Data Services > Data Definition.
  4. Provide the details (Name, Description).
  5. Select Next and provide the Transport Request number.
  6. Select Finish.
  7. Provide the data source name and add the elements in the CDS views.
  8. Provide the root statement to the top node as shown below.
    data model with CDS views
  9. Similarly, create consumption views and add required annotations.

 

Result Screen

Interface view SAP RAP

Figure 1: Interface view

Consumption view SAP RAP

Figure 2: Consumption view

Create Behavior Definition

Procedure

  1. Right-click on root CDS view
  2. Select New Behavior Definition
  3. Provide the details (Name, Description).
  4. Select Next and provide the Transport Request number.
  5. Select Finish.

Create Behavior Definition

Add transactional behaviour in Behavior Definition

Add transactional behaviour to Behavior Definition as shown below.

Add transactional behaviour in Behavior Definition

Create OData service

a.       Create Service Definition

Procedure

  1. Right-click on root CDS view
  2. Select New Service Definition
  3. Provide the details (Name, Description).
  4. Select Next and provide the Transport Request number.
  5. Select Finish.

Create Service Definition

b.      Expose CDS view

Expose CDS view

 

c.       Create Service Binding

Procedure

  1. Right-click on Service Definition
  2. Select New Service Binding
  3. Provide the details (Name, Description).
  4. Select Next and provide the Transport Request number.
  5. Select Finish.

SAP RAP Create Service Binding

d.      Publish OData Service

Publish OData Service SAP RAP

Application Preview

Fiori App SAP RAP

Fiori Detail Page SAP RAP

 

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.