ERPClimb logoERPClimb
RAP Basics
Architect / Cross-trackintermediate 9 min read

RAP Basics Part 2: Data Model Design — Tables, Keys, Administrative Fields and Interface Views

Preview · a free account unlocks the full lesson

Key takeaway

Design the persistence and interface layer of a RAP BO: UUID versus semantic keys, the administrative fields RAP needs for ETags and draft (created/changed by/at, local and total last changed), client handling, and building the interface root view entity on top of the table.

In this lessonShow sections

Visual overview

RAP Basics Part 2: Data Model Design — Tables, Keys, Administrative Fields and Interface Views — learning sheetFlow: Create ZTRAVEL_A with client, travel_uuid (key), travel_id, business fields, admin fields → Create ZI_Travel as root view entity with aliases and @Semantics annotations → Activate and run a data preview → Plan how travel_id will be filled (determination on save). Key ideas: ONE TABLE PER ENTITY; KEY STRATEGY; ADMINISTRATIVE FIELDS; THE INTERFACE VIEW. Watch out: Without local_last_changed_at (instance ETag) and last_changed_at (total ETag for draft), concurrent changes can silently overwrite each other.ERPClimb.com / ARCH / LESSON 2/11 / LEARNING SHEETRAP Basics Part 2: Data Model Design — Tables, Keys,Administrative Fields and Interface Views1 · HOW IT FLOWS1Create ZTRAVEL_Awith client,travel_uuid…2Create ZI_Travelas root viewentity with…3Activate and runa data preview4Plan howtravel_id willbe filled…2 · KEY IDEAS EXPLAINEDOne Table Per EntityRoot table (ZTRAVEL_A) and child tables(ZBOOKING_A), client-dependent (field clientfirst).Child table repeats the parent key (parent_uuid)to support composition.Key StrategyUUID key: technical, 16-byte raw, filled by"numbering : managed" — simplest, nonumber range needed.Semantic key: business number from a number range;requires early numbering (method) or latenumbering (at save).Administrative Fieldslocal_created_by / local_created_at,local_last_changed_by, local_last_changed_at,last_changed_at.local_last_changed_at: instance ETag — changes onevery change of this instance.The Interface Viewdefine root view entity ZI_Travel as select fromztravel_a — the root carries "root".Child: define view entity ZI_Booking … withassociation to parent (Part 5).3 · REMEMBER · WATCH OUTRememberA RAP BO starts with its own database tables (one per entity); thetable design decides keys, numbering and concurrency handling.UUID keys (sysuuid_x16) allow managed early numbering — the frameworkfills them; semantic keys (order number) need your own numbering…Administrative fields with @Semantics annotations let the frameworkfill created/changed by/at automatically and support ETag and draft…!Watch outWithout local_last_changed_at(instance ETag) and last_changed_at(total ETag for draft), concurrentchanges can silently overwrite eachother.4 · IN A REAL PROJECTAn animal-health client's first RAP BO for trade promotions used the promotion number from a number range asthe table key, drawn in early numbering. During testing with draft, users abandoned many drafts, burningthousands of numbers and creating gaps that finance auditors questioned. The architect redesigned with a UUID…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 1 showed the layers of a RAP business object; now we design the bottom layer — the tables and interface views. A RAP BO starts with its own database tables, one per entity, and the table design is really what decides keys, numbering, and how concurrency gets handled.

The root table, for example ZTRAVEL_A, and child tables such as ZBOOKING_A, are client-dependent, with the client field listed first, and a child table repeats the parent's key as parent_uuid to support the composition relationship. Draft tables, such as ZTRAVEL_D, are generated later directly from the BDEF and should never be designed by hand.

There are really two key strategies. A UUID key (sysuuid_x16) is technical, 16 bytes raw, and filled automatically through "numbering : managed" — this is the simplest option and needs no number range.

A semantic key, by contrast, is a real business number drawn from a number range, which requires either early numbering (via a method) or late numbering (assigned only at save).

A common and practical pattern is to use a UUID as the actual key while filling a separate, semantic ID through a determination on save — keeping a human-readable ID like TravelID next to the UUID key is worthwhile, since users never actually see the UUID itself.

Free account

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

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.