Appearance
Lesson 8 Practice — Design Support Issue Persistence
Today you learned how to design custom persistence.
Your self-practice task is to build a different model without copying the Reservation table line by line.
You will create:
text
Support Issue persistenceTarget architecture:
text
ZDM_ISTAT_###
↓
ZDE_ISTAT_###
↓
ZISSUE_###Do not create an ABAP SQL write class today.
That belongs to Lesson 9.
Practice information
| Expected time | About 3 hours |
| Environment | SAP BTP ABAP Trial |
| Required objects | ZDM_ISTAT_###, ZDE_ISTAT_###, ZISSUE_### |
| Main skill | Persistence design |
| SQL writes | Not yet |
Part 1 — Review a weak design
A developer proposes:
abap
define table zissue_### {
key issue_no : abap.numc(8);
title : abap.char(80);
status : abap.char(1);
estimated_cost : abap.curr(10,2);
currency_code : abap.cuky;
}Before creating anything, identify at least seven weaknesses compared with today's design principles.
Consider:
text
row identity
client handling
business vs technical key
reusable business type
required fields
amount/currency semantics
future RAP use
administrative fields
table annotationsWrite your findings.
Part 2 — Define the row grain
Complete:
text
One row in ZISSUE_### represents:
________________________________________Your answer should be precise enough that another developer could decide whether a field belongs in this table.
Part 3 — Decide technical and business identity
The model needs:
text
UUID
Issue NumberComplete:
text
Technical identifier:
_____________________
Business-facing identifier:
_____________________Then answer:
Why should
issue_nonot be the only technical primary key in this course design?
Part 4 — Create the Issue Status Domain
Create:
text
ZDM_ISTAT_###Requirements:
text
Type: CHAR
Length: 1Fixed values:
| Value | Meaning |
|---|---|
O | Open |
I | In Progress |
C | Closed |
Activate it.
Part 5 — Create the Issue Status Data Element
Create:
text
ZDE_ISTAT_###Requirements:
- use
ZDM_ISTAT_###; - maintain useful labels;
- activate successfully.
Explain in one paragraph:
What does the Data Element add beyond the Domain?
Part 6 — Plan the Support Issue table
Create:
text
ZISSUE_###One issue needs:
text
client
uuid
issue_no
title
description
requester_email
priority
status
reported_on
estimated_cost
currency_code
local_created_by
local_created_at
local_last_changed_by
local_last_changed_at
last_changed_atBefore coding, group the fields into:
text
technical key
business data
amount/currency pair
administrative fieldsPart 7 — Create the table object
Use the ADT Database Table wizard.
Requirements:
text
Name: ZISSUE_###
Description: Support IssuesUse the same application-table annotation strategy as the guided lesson:
text
transparent
delivery class A
restricted generic maintenance
not extensiblePart 8 — Define the key
The table must be client-dependent.
Technical key:
text
client + uuidRequirements:
text
client → ABAP client type
uuid → SYSUUID_X16
both → key
both → NOT NULLPart 9 — Define the business fields
Use these requirements:
| Field | Type | Required? |
|---|---|---|
issue_no | NUMC(8) | Yes |
title | CHAR(80) | Yes |
description | CHAR(255) | No |
requester_email | CHAR(100) | No |
priority | CHAR(1) | No |
status | your Data Element | Yes |
reported_on | DATS | Yes |
estimated_cost | CURR(10,2) | No |
currency_code | CUKY | No |
Do not look at the Companion reference until you have attempted the table yourself.
Part 10 — Add amount/currency semantics
Connect:
text
estimated_costto:
text
currency_codeusing the Database Table semantic annotation form taught today.
Write the completed annotation before activating.
Part 11 — Add RAP administrative fields
Add:
text
local_created_by
local_created_at
local_last_changed_by
local_last_changed_at
last_changed_atUse the standard RAP reuse Data Elements from the lesson.
Then answer:
Which field is intended for a future local ETag?
Which field will matter for a future total ETag/draft scenario?
Part 12 — Syntax check and activate
Run:
text
Ctrl + F2
Ctrl + F3Resolve every activation error.
Do not continue with an inactive table.
Part 13 — Data Preview
Open Database Table Data Preview using:
text
Alt + F8or:
text
Open With → Data PreviewExpected result:
text
0 rowsRecord:
text
Table active: Yes / No
Data Preview opens: Yes / No
Initial row count: ________Part 14 — Design audit
Audit your finished table.
Answer:
1. What is the full primary key?
2. Why is client not authorization?
3. Why is the UUID technical rather than business-facing?
4. Why is Status based on a Data Element?
5. What does the currency annotation add?
6. Why are the RAP administrative fields present before RAP behavior exists?
7. What does NOT NULL mean, and what does it not mean?
Part 15 — Repair exercise
Assume another student writes:
abap
key uuid : sysuuid_x16;
@Semantics.amount.currencyCode : 'CurrencyCode'
estimated_cost : abap.curr(10,2);
status : zdm_istat_###;Identify the problems for this Database Table design.
Repair the three lines conceptually.
Do not just say:
text
syntax errorExplain the modeling reason.
Part 16 — Certification-style recall
Without looking at the guided source, write the five RAP administrative field types from memory.
Then verify them.
Use this method:
text
attempt
↓
verify
↓
correctThat is more useful than copying them immediately.
Part 17 — Compare table and CDS
Complete:
| Question | Database Table | CDS View Entity |
|---|---|---|
| Stores physical application rows? | ||
Defined with define table? | ||
Defined with define view entity? | ||
| Can be used as a query/model layer? | ||
| Is today's main persistence object? |
Part 18 — Stop line
At the end of today's Practice, you should have:
text
ZDM_ISTAT_### active
↓
ZDE_ISTAT_### active
↓
ZISSUE_### active
↓
0 rowsDo not create:
text
ZCL_ISSUE_SQL_###yet.
Tomorrow's Practice will use this exact table.
Optional challenge — Model Priority as a reusable type
Only after the required work is complete, create a reusable Priority type.
Suggested values:
text
L = Low
M = Medium
H = HighUse the same pattern:
text
Domain
↓
Data Element
↓
priority fieldThis challenge repeats today's concept without introducing a new architecture.
Submission checklist
Useful ADT actions
| Action | Shortcut |
|---|---|
| Open object | Ctrl + Shift + A |
| Content assist | Ctrl + Space |
| Quick Fix | Ctrl + 1 |
| Syntax check | Ctrl + F2 |
| Activate | Ctrl + F3 |
| Activate related inactive objects | Ctrl + Shift + F3 |
| Database table Data Preview | Alt + F8 |