Dealing with Existing Code in SAP RAP

by | Aug 18, 2021 | ABAP RAP

Preface – This post is part of the SAP ABAP RAP series.

Introduction

This article will provide the step-by-step enabling of existing code in RAP. Using the steps below we will learn “Dealing with Existing Code in SAP RAP”.

Steps:

  1. Create data model with CDS views
  2. Create Behavior Definition
  3. Add transactional behaviour in Behavior Definition
  4. Create Behavior Pool
  5. Implement transactional behavior of the existing application

Create data model with CDS views

Click here to follow step 1

Create Behavior Definition

Procedure

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

Create Behavior Definition SAP RAP

Add transactional behaviour in Behavior Definition

Add transactional behavior (Create/Update/Delete/Actions) of business objects.

Add transactional behaviour in Behavior Definition SAP RAP

Add transactional behaviour in Behavior Definition ABAP RAP

Create Behavior Pool

You can assign any number of behavior pools to behavior definition. Within a single global class, you can implement multiple local classes which defines the transactional behavior of the business object.

 

Procedure

Behavior Definition >> Right-click >> select New Behavior Implementation >> Provide details >> Finish

Splitting implementation into different behavior pools

Figure 1:Splitting implementation into different behavior pools

 

Behavior Pool

Figure 2: Behavior Pool

When you go to Local Types in Behavior Pool, you can see below local classes.

local classes in Behavioral Pool

local implementation classes SAP RAP

Within these local implementation classes, you can implement the business logic of existing behavior objects and test the end-to-end scenario using EML (Entity Manipulation Language) syntax.

Author

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

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