Appearance
Lesson 16 Practice — Expose the Support Issue BO with OData V4
Your Support Issue BO already has:
text
managed CRUD
EML
determinations
validations
messages
actions
feature control
authorizationNow expose it as a consumer-facing RAP business service.
Target architecture:
text
ZISSUE_###
↓
ZR_ISSUE_###
↓
ZC_ISSUE_###
↓
Projection BDEF
↓
ZUI_ISSUE_###
↓
ZUI_ISSUE_###_O4
↓
OData V4 UI
↓
Fiori Elements PreviewPractice information
| Time | About 3 hours |
| Prerequisite | Lesson 16 teacher-led work |
| Base BO | ZR_ISSUE_### |
| Projection | ZC_ISSUE_### |
| Service Definition | ZUI_ISSUE_### |
| Service Binding | ZUI_ISSUE_###_O4 |
| Protocol | OData V4 UI |
| Main goal | Expose the secured Issue BO without duplicating business logic |
1. Verify the starting BO
Confirm these activate:
text
ZISSUE_###
ZR_ISSUE_###
base Access Control
Behavior Definition
ZBP_R_ISSUE_###You should already have:
text
ResponsibleUser
DCL
global authorization
instance authorization
startProcessing action
close action
dynamic feature controlDo not start the service layer until the base BO works.
2. Objects to create
Create:
text
ZC_ISSUE_###
Access Control for ZC_ISSUE_###
Projection Behavior Definition for ZC_ISSUE_###
Metadata Extension for ZC_ISSUE_###
ZUI_ISSUE_###
ZUI_ISSUE_###_O4Do not create:
text
new persistence table
new Behavior Pool
draft table
draft BDEF3. Design the projection
The projection should expose these business fields:
text
Uuid
IssueNo
Title
Description
RequesterEmail
Priority
Status
ReportedOn
EstimatedCost
CurrencyCode
ResponsibleUserAlso expose the administrative fields required for service behavior/debugging.
4. Create ZC_ISSUE_###
Use:
text
define root view entityand:
text
provider contract transactional_queryProject from:
text
ZR_ISSUE_###5. Projection header requirements
Use:
text
@AccessControl.authorizationCheck: #CHECK
@Metadata.allowExtensions: true
@Search.searchable: trueProvide a useful end-user label.
6. Search fields
Make these default search elements:
text
IssueNo
TitleDo not mark every field as a default search field.
7. Currency value help
Add a value help to:
text
CurrencyCodeUse the same standard provider used in the guided Reservation lesson:
text
I_CurrencyStdVHMap to:
text
CurrencyUse the current @Consumption.valueHelpDefinition syntax.
8. Value help reasoning
Answer:
Does value help validate all business rules?
Does value help replace validateCost?
Why is value help a projection-layer concern?
9. Activate and preview the projection
Use:
text
Ctrl+F3
F8At this moment, inspect whether the projection reveals only the data you expect.
Do not assume the base DCL automatically protects it.
10. Explain DCL propagation
Complete:
text
Base DCL protects:
____________________
Projection entity is:
____________________
Does CDS automatically inherit access controls?
____________________The correct architectural answer must acknowledge that the projection needs its own access control.
11. Create projection Access Control
Create an Access Control object for:
text
ZC_ISSUE_###Requirements:
text
@MappingRole: true
grant select on ZC_ISSUE_###
inherit conditions from ZR_ISSUE_###Do not manually duplicate the ResponsibleUser condition.
12. Required DCL source shape
Your DCL should be equivalent to:
abap
@EndUserText.label: 'Issue Projection Access'
@MappingRole: true
define role ZC_Issue_###
{
grant select on ZC_Issue_###
where inheriting conditions from entity ZR_Issue_###;
}Use the exact names from your objects.
13. Re-test projection Data Preview
After activating the projection DCL:
text
F8Expected:
text
the projection respects the same read authorization
as the base Issue entityIf you intentionally still have an unassigned Issue, it must not reappear through the projection.
14. Create projection BDEF
Right-click:
text
ZC_ISSUE_###Create a Behavior Definition with:
text
Implementation Type: Projection15. Projection BDEF header
Use:
abap
projection;
strict ( 2 );Do not create:
text
managed implementation
unmanaged implementation
new behavior pool16. Reuse ETag
If your base Issue BO uses:
text
LocalLastChangedAtas ETag master, reuse ETag behavior in the projection.
Required concept:
text
use etag17. Reuse standard operations
Expose:
text
create
update
deletewith projection behavior syntax.
Remember:
text
use create
use update
use deletedoes not reimplement CRUD.
18. Reuse actions
Expose:
text
startProcessing
closethrough the projection BDEF.
Do not copy action implementation into a new class.
19. Projection BDEF target
Your final behavior should be equivalent to:
abap
projection;
strict ( 2 );
define behavior for ZC_Issue_### alias Issue
use etag
{
use create;
use update;
use delete;
use action startProcessing;
use action close;
}Adjust names to your actual entity/alias.
20. Explain reused behavior
For each item, state where the implementation still lives:
text
create:
____________________
validateTitle:
____________________
setInitialStatus:
____________________
startProcessing:
____________________
instance authorization:
____________________
feature control:
____________________A correct answer should point back to the base RAP BO / Behavior Pool, not the projection.
21. Create metadata extension
Enable metadata extensions in the projection.
Then create a Metadata Extension for:
text
ZC_ISSUE_###Use:
text
@Metadata.layer: #CORE22. Header information
Configure:
text
typeName = Issue
typeNamePlural = Issues
title field = IssueNoUse:
text
@UI.headerInfoAlso add an identification-reference facet so the object page has a clear main section.
23. List-report fields
Add @UI.lineItem annotations for:
text
IssueNo
Title
Priority
Status
ReportedOn
EstimatedCost
CurrencyCode
ResponsibleUserChoose sensible positions.
24. Object-page fields
Add @UI.identification for at least:
text
IssueNo
Title
Description
RequesterEmail
Priority
Status
ReportedOn
EstimatedCost
CurrencyCode
ResponsibleUser25. Selection fields
Use @UI.selectionField for:
text
Priority
Status
ReportedOn
CurrencyCodeDo not make every field a filter.
25A. Expose action buttons in UI metadata
Add Fiori Elements action records for:
text
startProcessing
closeUse:
text
type: #FOR_ACTIONand the correct:
text
dataActioninside both:
text
@UI.lineItem
@UI.identificationYou may attach the annotations to the Status element.
The action names must match the names exposed by the projection BDEF.
26. Metadata separation reasoning
Explain why:
text
@UI.lineItembelongs in the metadata extension but:
text
validateTitledoes not.
27. Create Service Definition
Create:
text
ZUI_ISSUE_###Expose:
text
ZC_ISSUE_###
I_CurrencyStdVHUse service aliases.
Recommended aliases:
text
Issues
Currencies28. Service Definition source target
Equivalent source:
abap
@EndUserText.label: 'Issue UI Service'
define service ZUI_ISSUE_###
{
expose ZC_Issue_### as Issues;
expose I_CurrencyStdVH as Currencies;
}Activate it.
29. Explain why Currencies is exposed
Your answer must mention:
text
value-help provider
OData service
CurrencyCode30. Create Service Binding
Create:
text
ZUI_ISSUE_###_O4Use:
text
Service Definition:
ZUI_ISSUE_###
Binding:
OData V4 UIActivate it.
31. Publish
Open the Service Binding editor.
Publish the service locally.
Record:
text
Published:
Yes / NoDo not confuse publishing with productive launchpad deployment.
32. Inspect service entities
The binding should contain entities equivalent to:
text
Issues
CurrenciesIf the value-help entity is missing, repair the Service Definition.
33. Launch Fiori Elements Preview
Select:
text
IssuesLaunch Preview.
The generated UI should use the metadata extension.
34. Verify list columns
Record whether these are visible:
text
IssueNo
Title
Priority
Status
ReportedOn
EstimatedCost
CurrencyCode
ResponsibleUserRepair metadata rather than changing the base persistence model.
35. Verify search
Use search with:
text
IssueNo
or
TitleRecord one successful search.
36. Verify selection fields
Check the filter area for:
text
Priority
Status
ReportedOn
CurrencyCodeRecord any differences caused by the current preview/UI layout.
37. Verify Currency value help
Open the value help for:
text
CurrencyCodeConfirm that a currency list is available.
Record one selected currency.
38. Verify DCL through service
The UI service must not reveal Issues that the current user is not authorized to read.
Explain which artifact protects:
text
ZC_ISSUE_###from accidentally reopening read access.
39. Verify state-based action behavior
Use an owned:
text
Status = OIssue.
Expected:
text
startProcessing available
close unavailableExecute:
text
startProcessingand verify:
text
Status = I40. Re-check actions after state change
For:
text
Status = Iexpected:
text
startProcessing unavailable
close availableThis behavior should come from:
text
base feature controlnot new UI code.
41. Execute close
Run:
text
closeExpected:
text
I → CVerify final Status through the preview or a protected CDS read.
42. Verify dynamic field control
For:
text
Status = Cthe cost fields should reflect Lesson 14 behavior:
text
EstimatedCost read-only
CurrencyCode read-onlyExplain why no new projection handler was required.
43. Verify backend validation
Attempt an invalid create/update through the service.
Examples:
text
blank Title
future ReportedOn
negative EstimatedCostExpected:
text
backend validation prevents invalid save
useful RAP message returned44. Verify authorization
Use only an Issue whose:
text
ResponsibleUser = current userfor successful updates/actions.
Explain what should happen if:
text
state allows action
but current user is not authorized45. Repair exercise — remove provider contract
Temporarily reason about omitting:
text
provider contract transactional_queryRestore it.
Explain why current projection modeling should specify its provider contract explicitly.
46. Repair exercise — remove root
Temporarily change:
text
define root view entityto:
text
define view entityRestore the correct root projection.
Explain the BO role lost by the incorrect declaration.
47. Repair exercise — omit projection action
Remove:
text
use action closetemporarily.
Activate and inspect the service behavior.
Restore it.
Explain:
text
base action exists
but service projection decides whether it is exposed48. Repair exercise — remove projection DCL
Do not leave the system in this state.
Reason about what could happen if:
text
ZC_ISSUE_###has no access control while only:
text
ZR_ISSUE_###is protected.
Restore the projection DCL.
49. Repair exercise — omit value-help provider
Remove:
text
Currenciesfrom the Service Definition temporarily.
Inspect/consider the value-help result.
Restore it.
50. Repair exercise — put validation in metadata
Explain why this is architecturally wrong:
text
"Title is required"
implemented only as UI metadataWhere does the authoritative rule belong?
51. Repair exercise — Service Definition vs Binding
Complete:
text
If I need to add another CDS entity:
I change ______________________
If I need a different protocol:
I create/change ______________________52. Certification-style mini task
Create a second projection for a hypothetical read-focused Issue service.
Requirements:
text
new projection CDS
subset of fields
transactional_query provider contract
projection DCL protection
projection BDEF that exposes no delete
separate Service DefinitionYou do not need to publish it if time is limited.
Explain how this proves that projections are service-specific.
53. Certification-style repair map
Complete:
| Problem | First artifact to inspect |
|---|---|
| Action missing from service | |
| Unauthorized row appears | |
| Currency value help missing | |
| Wrong list column order | |
| Search does not use Title | |
| OData endpoint missing | |
| Validation accepts bad Title |
54. Submission checklist
55. End-of-practice explanation
Explain without notes:
text
The base RAP BO contains reusable business behavior.
The projection defines the service-specific data surface.
The projection BDEF defines which base operations
the service exposes.
The projection needs its own read protection
because CDS DCL does not automatically propagate.
The metadata extension describes the UI.
The Service Definition chooses what is exposed.
The Service Binding chooses how it is exposed.
OData V4 carries the RAP BO to a UI consumer.
The service still uses the original validations,
actions, feature control, and authorization.If you can build and explain that stack, you are ready for Lesson 17 Draft.