Let us consider we have been given a green field and asked us to develop a villa from scratch with our own customization. So, what steps will be involved in it? We need to design the floor-plan of the villa, the sections we want to include in the house like pool area, a garden, a jogging track etc. And we will proceed with selecting materials, selecting vendors, enforcing conciliation and orders and many more steps. Similarly, the RAP’s managed scenario provides the greenfield development for our business object.
In the managed scenario, the implementations of behavioral elements like Create/Update/Delete are managed by the RAP framework itself. However, to implement complex logic like validations, determination or some sort of actions (Submit, Approval, Reject etc) on the business entity, you need to add the ABAP logic for it in implementing classes.
How to implement managed scenario?
Pre-requisite: Create CDS views.
- Right-click on root CDS view and select NEW BEHAVIOUR DEFINITION.
- Add package details, description.
- Select implementation type MANAGED. This is most important part of creating the managed implementation.
- Click on Next and then click on Finish.
Points to consider
- It is available only on S/4 HANA Cloud.
- The framework will handle the CRUD operations by itself.
- It is more like BOPF where we are responsible to define what tables should be updated at the end.
- You can implement DETERMINATIONS, VALIDATIONS, and ACTIONS by adding logic in implementing class.
- The managed scenario does not support LATE NUMBERING. Late numbering refers to the late number assignment of primary key fields. The final value is assigned just before the data is saved to the database. We will learn more about in unmanaged scenario of RAP.
- We implement EARLY NUMBERING in the managed scenario. Using early numbering will draw the UUID automatically during the CREATE request by RAP runtime.
Early numbering is only possible with the key field of type raw(16) (UUID) of the business object.
- The early numbering should be defined at BEHAVIOUR DEFINITION level.
- Actions: Instance factory actions are not supported.