Preface – This post is part of the SAP ABAP RAP series.
Table of Contents
Introduction
This article will provide a step-by-step guide to enable the transactional behaviour of an application in SAP RAP.
- Create data model with CDS views
- Create Behavior Definition
- Add transactional behaviour in Behavior Definition
- Create OData service
- Create a Service Definition
- Expose CDS view
- Create Service Binding
- Publish OData service
- Application preview
Create data model with CDS views
Procedure
- Launch ADT (ABAP Development Tool).
- Select package for your development.
- Right-click on package and choose NEW > Other Repository Objects > Core Data Services > Data Definition.
- Provide the details (Name, Description).
- Select Next and provide the Transport Request number.
- Select Finish.
- Provide the data source name and add the elements in the CDS views.
- Provide the root statement to the top node as shown below.
- Similarly, create consumption views and add required annotations.
Result Screen
Figure 1: Interface view
Figure 2: Consumption view
Create Behavior Definition
Procedure
- Right-click on root CDS view
- Select New Behavior Definition
- Provide the details (Name, Description).
- Select Next and provide the Transport Request number.
- Select Finish.
Add transactional behaviour in Behavior Definition
Add transactional behaviour to Behavior Definition as shown below.
Create OData service
a. Create Service Definition
Procedure
- Right-click on root CDS view
- Select New Service Definition
- Provide the details (Name, Description).
- Select Next and provide the Transport Request number.
- Select Finish.
b. Expose CDS view
c. Create Service Binding
Procedure
- Right-click on Service Definition
- Select New Service Binding
- Provide the details (Name, Description).
- Select Next and provide the Transport Request number.
- Select Finish.
d. Publish OData Service
Application Preview
0 Comments