Skip to content

Lesson 10 Practice — Model the Support Issue RAP Root ​

Today you learned how to build the structural root of a RAP Business Object.

Now apply the same architecture to the Support Issue persistence you created earlier.

You already own:

text
ZISSUE_###

Your task is to create:

text
ZR_ISSUE_###

This is a requirements-based practice.

You will not receive the complete source up front.


Practice information ​

TimeAbout 3 hours
PrerequisiteLesson 10 teacher-led work
Existing persistenceZISSUE_###
New objectZR_ISSUE_###
Behavior Definition today?No
Main goalRAP root data model

1. Scenario ​

The Support Issue table stores application-owned issue data.

The persistence includes concepts such as:

text
UUID
Issue Number
Title
Description
Requester Email
Priority
Status
Reported On
Estimated Cost
Currency
administrative fields

Today you will turn that persistence structure into the root data model of a future RAP Business Object.


2. Architecture target ​

Build:

text
ZISSUE_###
    ↓
ZR_ISSUE_###

Interpret this as:

text
physical persistence
    ↓
RAP BO root data model

Do not create the Behavior Definition.


3. Create the root Data Definition ​

Create:

text
ZR_ISSUE_###

Use a description such as:

text
Support Issue RAP Root

The CDS entity must use:

abap
define root view entity

not:

abap
define view entity

4. Source object ​

Select directly from:

text
ZISSUE_###

Give the data source a clear alias.

For example:

text
Issue

Do not add joins or associations today.

The purpose of this practice is BO structure.


5. Authorization annotation ​

Use the same training-stage authorization baseline as the guided exercise:

text
authorization check not required

This makes DCL optional. An existing DCL role would still apply; this annotation does not disable it.

This is not a production authorization design.

Authorization is taught later.


6. CDS key ​

Expose:

text
Uuid

as the CDS key.

Do not expose:

text
client

as an ordinary property.

Before coding, answer:

Why is the physical table key not exposed exactly as client + uuid? ​


7. Business-facing aliases ​

Expose business fields with clear CDS names.

Your root should contain concepts equivalent to:

text
IssueNo
Title
Description
RequesterEmail
Priority
Status
ReportedOn
EstimatedCost
CurrencyCode

Use the database fields from your own ZISSUE_### implementation.

Keep naming consistent.


8. Amount/currency semantics ​

Your persistence contains:

text
Estimated Cost
Currency Code

The CDS root must preserve the semantic relationship:

text
EstimatedCost
→
CurrencyCode

Do not reference the database field name if your CDS element has a different alias.


9. Administrative fields ​

Expose all five fields:

text
LocalCreatedBy
LocalCreatedAt
LocalLastChangedBy
LocalLastChangedAt
LastChangedAt

Apply the appropriate semantics for:

text
created user
created timestamp
local last-changed user
local last-changed timestamp
total last-changed timestamp

Use the guided Reservation root as a pattern.

Do not copy blindly.


10. Root-entity reasoning ​

Before activation, answer:

Why is ZR_ISSUE_### a root entity even though it has no children? ​

What makes Uuid different from the root designation? ​

Is ZR_ISSUE_### a new database table? ​

Does the root CDS already enable create/update/delete through RAP? ​


11. Activate ​

Run:

text
Ctrl+F2

for syntax check.

Then:

text
Ctrl+F3

to activate.

Repair any syntax or semantic errors.

Do not create a Behavior Definition to work around a CDS problem.


12. Preview ​

Open CDS Data Preview:

text
F8

The result may contain zero rows.

That is acceptable.

Inspect:

text
column names
key
administrative fields

Verify the amount/currency reference and administrative annotations in the CDS source and syntax-check results. Data Preview alone does not verify their runtime behavior.


13. Architecture audit ​

Complete:

text
Persistence:
____________________

RAP root entity:
____________________

Technical entity key:
____________________

Business-facing issue identifier:
____________________

Then draw:

text
__________
    ↓
__________
    ↓
[ Behavior Definition — not created yet ]

14. Managed vs unmanaged decision ​

Based only on what you know today, choose which future implementation model best fits this Issue scenario:

text
managed
or
unmanaged

Justify the choice using at least three facts about the scenario.

Possible facts to think about:

text
Who owns the persistence?
Is it new or legacy?
Is there an existing save API?
Is it normal database persistence?
Does it already have a UUID key?

Do not create the BDEF.


15. Repair exercise A — missing root ​

Temporarily change:

abap
define root view entity

to:

abap
define view entity

Run syntax check/activate.

Then restore the correct source.

Answer:

Does the CDS still represent data? ​

What architectural meaning was lost? ​


16. Repair exercise B — expose client ​

Temporarily add the technical client field from your source table to the select list. For the alias Issue, use:

abap
key Issue.client as Client,

Run the syntax check and read the error. CDS View Entities handle clients implicitly and do not permit the technical client field in their select lists. Remove the invalid field, then reactivate the correct source.

Explain:

How does implicit client handling explain both the error and the absence of Client from the BO key? ​


17. Repair exercise C — remove the CDS key ​

Temporarily remove:

text
key

from Uuid.

Run syntax check/activate and observe the result.

Restore the final correct model.

Record:

text
What happened:
Why:

18. Repair exercise D — break the currency reference ​

Temporarily make the amount annotation point to a name that does not exist.

For example, if your element is:

text
CurrencyCode

reference a wrong name.

Run syntax check.

Read the ADT message.

Repair it.

Explain:

Does the semantic annotation reference the persistence field name or the CDS element name? ​


19. Compare storage and business model ​

Create a small mapping table in your notes:

Persistence fieldCDS element
uuidUuid
issue_no
title
description
requester_email
priority
status
reported_on
estimated_cost
currency_code

Complete the missing values.

Then answer:

Why is this mapping useful before we add behavior? ​


20. Explain the admin fields ​

In one sentence each, explain:

text
LocalCreatedBy
LocalCreatedAt
LocalLastChangedBy
LocalLastChangedAt
LastChangedAt

Then mark which one you expect to become the local ETag field in the next lesson.


21. Do not implement tomorrow's concepts today ​

Your final practice submission must not contain:

text
Behavior Definition
Behavior Pool
managed implementation
strict ( 2 )
persistent table mapping
lock master
etag master
create;
update;
delete;
EML
Service Definition
Service Binding

If you already created any of those while experimenting, remove/defer them so the submitted Lesson 10 state remains focused.


22. Certification-style explanation ​

Without looking at your notes, explain aloud or in writing:

A database table stores Support Issue state. ZR_ISSUE_### does not replace that table. It models the Support Issue as the root entity of a future RAP Business Object. The CDS root defines structure; the Behavior Definition will later define the transactional behavior.

Do not memorize the wording.

Make sure you can explain the idea.


23. Optional challenge — inspect an SAP RAP root ​

Find one SAP-delivered RAP root entity available in your Trial system.

Look for:

text
define root view entity

Record:

text
Object:
Persistence source:
Key:
One business field:
One administrative field:
One association or composition, if present:

Do not copy the object.

The goal is architectural recognition.


24. Submission checklist ​


25. End-of-practice model ​

Your final architecture should be:

text
ZISSUE_###
    ↓
ZR_ISSUE_###
    ↓
[ Behavior Definition — Lesson 11 ]

If you can explain every line in that diagram, you are ready for managed behavior.