RAP Build-Along Part 2: Persistence Tables, Root and Child CDS Views
Preview · a free account unlocks the full lesson
Part 2 of the RAP Bootcamp builds the data foundation of the Travel + Booking app: active and draft tables, UUID keys with readable business IDs, audit fields, and the CDS root and child view entities connected by composition and parent association — with a working activation order and a checkpoint.
In this lessonShow sectionsHide sections
Visual overview
Explanation
By the end of this part, your package will contain six artifacts: an active root table ZRAP_TRAVEL holding persisted Travel rows, an active child table ZRAP_BOOKING holding persisted Booking rows, a draft root table ZRAP_TRAV_D and draft child table ZRAP_BOOK_D for draft Travel and Booking rows (both generated in Part 3), a root CDS view entity ZI_RAP_Travel acting as the business object's root, and a child CDS view entity ZI_RAP_Booking composed under it with a parent association.
There's no behavior yet — the goal here is just a data model that previews correctly in the ADT Data Preview and is ready to carry a managed behavior definition in Part 3.
Before starting, you should have completed Part 1, understand the artifact chain, and have a transportable package (for example ZRAP_TRAVEL_APP) with a transport request, along with ADT connected to an ABAP system that supports RAP managed scenarios with draft — SAP BTP ABAP Environment, SAP S/4HANA Cloud Public Edition developer extensibility, or a recent SAP S/4HANA on-premise/private release all work, though available syntax differs by release, which this lesson calls out where relevant — plus authorization to create dictionary objects and CDS in your package.
A RAP business object is fundamentally a tree, and here that tree is simple: Travel is the root, backed by table ZRAP_TRAVEL and CDS view ZI_RAP_Travel, with Booking as its child, backed by table ZRAP_BOOKING and CDS view ZI_RAP_Booking. A handful of decisions need to be made before any typing starts, because they're expensive to change later.
The technical key for both entities is a 16-byte UUID (sysuuid_x16); UUIDs let the managed framework assign keys at create time without number-range objects and make draft handling simple.
Alongside that, a readable business ID — travel_id, something like "00000042" — is shown to users; it is not the key itself, and Part 3 and Part 4 cover how it gets filled. The parent foreign key, ZRAP_BOOKING-parent_uuid, stores the Travel UUID, while the child's own key is booking_uuid.
Administrative fields — created by/at, last changed by/at, and a local last-changed timestamp — feed ETag handling and audit trails in Part 3. And every amount field needs a currency field sitting next to it.
Create a free account to keep reading
You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.
- Full explanation
- Code example
- Real project scenario
- Common mistakes
- Best practices
- Interview angle
One tap with Google works too. Every topic keeps its first lesson open to everyone.
Keep exploring
More lessons in this topic
- RAP Basics Part 1: RAP Architecture — Layers, Artifacts and When RAP Fits
- RAP Basics Part 10: EML — Entity Manipulation Language
- RAP Basics Part 11: Draft, Locking and Authorization
- RAP Basics Part 2: Data Model Design — Tables, Keys, Administrative Fields and Interface Views
- RAP Basics Part 3: Projection Layer and Metadata Extensions
- RAP Basics Part 4: Implementation Types — Managed, Unmanaged, Additional Save and Unmanaged Save
- RAP Basics Part 5: Root Entity, Child Entity and Composition
- RAP Basics Part 6: Behavior Definition — CRUD, Field Control and Features
Interview questions on this topic
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.