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”.
- Create data model with CDS views
- Create Behavior Definition
- Add transactional behaviour in Behavior Definition
- Create Behavior Pool
- Implement transactional behavior of the existing application
Create data model with CDS views
Create Behavior Definition
- Right-click on root CDS view
- Select New Behavior Definition
- Provide the details (Name, Description).
- Select implementation type as unmanaged
- Click Next and provide the Transport Request number.
- Select Finish.
Add transactional behaviour in Behavior Definition
Add transactional behavior (Create/Update/Delete/Actions) of business objects.
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.
Behavior Definition >> Right-click >> select New Behavior Implementation >> Provide details >> Finish
Figure 1:Splitting implementation into different behavior pools
Figure 2: Behavior Pool
When you go to Local Types in Behavior Pool, you can see below local classes.
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.