Skip to content

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 persistence

Target architecture:

text
ZDM_ISTAT_###
      ↓
ZDE_ISTAT_###
      ↓
ZISSUE_###

Do not create an ABAP SQL write class today.

That belongs to Lesson 9.


Practice information ​

Expected timeAbout 3 hours
EnvironmentSAP BTP ABAP Trial
Required objectsZDM_ISTAT_###, ZDE_ISTAT_###, ZISSUE_###
Main skillPersistence design
SQL writesNot 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 annotations

Write 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 Number

Complete:

text
Technical identifier:
_____________________

Business-facing identifier:
_____________________

Then answer:

Why should issue_no not 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: 1

Fixed values:

ValueMeaning
OOpen
IIn Progress
CClosed

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_at

Before coding, group the fields into:

text
technical key
business data
amount/currency pair
administrative fields

Part 7 — Create the table object ​

Use the ADT Database Table wizard.

Requirements:

text
Name:        ZISSUE_###
Description: Support Issues

Use the same application-table annotation strategy as the guided lesson:

text
transparent
delivery class A
restricted generic maintenance
not extensible

Part 8 — Define the key ​

The table must be client-dependent.

Technical key:

text
client + uuid

Requirements:

text
client → ABAP client type
uuid   → SYSUUID_X16
both   → key
both   → NOT NULL

Part 9 — Define the business fields ​

Use these requirements:

FieldTypeRequired?
issue_noNUMC(8)Yes
titleCHAR(80)Yes
descriptionCHAR(255)No
requester_emailCHAR(100)No
priorityCHAR(1)No
statusyour Data ElementYes
reported_onDATSYes
estimated_costCURR(10,2)No
currency_codeCUKYNo

Do not look at the Companion reference until you have attempted the table yourself.


Part 10 — Add amount/currency semantics ​

Connect:

text
estimated_cost

to:

text
currency_code

using 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_at

Use 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 + F3

Resolve every activation error.

Do not continue with an inactive table.


Part 13 — Data Preview ​

Open Database Table Data Preview using:

text
Alt + F8

or:

text
Open With → Data Preview

Expected result:

text
0 rows

Record:

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 error

Explain 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
  ↓
correct

That is more useful than copying them immediately.


Part 17 — Compare table and CDS ​

Complete:

QuestionDatabase TableCDS 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 rows

Do 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 = High

Use the same pattern:

text
Domain
  ↓
Data Element
  ↓
priority field

This challenge repeats today's concept without introducing a new architecture.


Submission checklist ​


Useful ADT actions ​

ActionShortcut
Open objectCtrl + Shift + A
Content assistCtrl + Space
Quick FixCtrl + 1
Syntax checkCtrl + F2
ActivateCtrl + F3
Activate related inactive objectsCtrl + Shift + F3
Database table Data PreviewAlt + F8