Skip to content

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
authorization

Now 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 Preview

Practice information ​

TimeAbout 3 hours
PrerequisiteLesson 16 teacher-led work
Base BOZR_ISSUE_###
ProjectionZC_ISSUE_###
Service DefinitionZUI_ISSUE_###
Service BindingZUI_ISSUE_###_O4
ProtocolOData V4 UI
Main goalExpose 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 control

Do 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_###_O4

Do not create:

text
new persistence table
new Behavior Pool
draft table
draft BDEF

3. Design the projection ​

The projection should expose these business fields:

text
Uuid
IssueNo
Title
Description
RequesterEmail
Priority
Status
ReportedOn
EstimatedCost
CurrencyCode
ResponsibleUser

Also expose the administrative fields required for service behavior/debugging.


4. Create ZC_ISSUE_### ​

Use:

text
define root view entity

and:

text
provider contract transactional_query

Project from:

text
ZR_ISSUE_###

5. Projection header requirements ​

Use:

text
@AccessControl.authorizationCheck: #CHECK
@Metadata.allowExtensions: true
@Search.searchable: true

Provide a useful end-user label.


6. Search fields ​

Make these default search elements:

text
IssueNo
Title

Do not mark every field as a default search field.


7. Currency value help ​

Add a value help to:

text
CurrencyCode

Use the same standard provider used in the guided Reservation lesson:

text
I_CurrencyStdVH

Map to:

text
Currency

Use 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
F8

At 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
F8

Expected:

text
the projection respects the same read authorization
as the base Issue entity

If 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: Projection

15. Projection BDEF header ​

Use:

abap
projection;
strict ( 2 );

Do not create:

text
managed implementation
unmanaged implementation
new behavior pool

16. Reuse ETag ​

If your base Issue BO uses:

text
LocalLastChangedAt

as ETag master, reuse ETag behavior in the projection.

Required concept:

text
use etag

17. Reuse standard operations ​

Expose:

text
create
update
delete

with projection behavior syntax.

Remember:

text
use create
use update
use delete

does not reimplement CRUD.


18. Reuse actions ​

Expose:

text
startProcessing
close

through 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: #CORE

22. Header information ​

Configure:

text
typeName       = Issue
typeNamePlural = Issues
title field    = IssueNo

Use:

text
@UI.headerInfo

Also 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
ResponsibleUser

Choose sensible positions.


24. Object-page fields ​

Add @UI.identification for at least:

text
IssueNo
Title
Description
RequesterEmail
Priority
Status
ReportedOn
EstimatedCost
CurrencyCode
ResponsibleUser

25. Selection fields ​

Use @UI.selectionField for:

text
Priority
Status
ReportedOn
CurrencyCode

Do not make every field a filter.


25A. Expose action buttons in UI metadata ​

Add Fiori Elements action records for:

text
startProcessing
close

Use:

text
type: #FOR_ACTION

and the correct:

text
dataAction

inside both:

text
@UI.lineItem
@UI.identification

You 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.lineItem

belongs in the metadata extension but:

text
validateTitle

does not.


27. Create Service Definition ​

Create:

text
ZUI_ISSUE_###

Expose:

text
ZC_ISSUE_###
I_CurrencyStdVH

Use service aliases.

Recommended aliases:

text
Issues
Currencies

28. 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
CurrencyCode

30. Create Service Binding ​

Create:

text
ZUI_ISSUE_###_O4

Use:

text
Service Definition:
ZUI_ISSUE_###

Binding:
OData V4 UI

Activate it.


31. Publish ​

Open the Service Binding editor.

Publish the service locally.

Record:

text
Published:
Yes / No

Do not confuse publishing with productive launchpad deployment.


32. Inspect service entities ​

The binding should contain entities equivalent to:

text
Issues
Currencies

If the value-help entity is missing, repair the Service Definition.


33. Launch Fiori Elements Preview ​

Select:

text
Issues

Launch 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
ResponsibleUser

Repair metadata rather than changing the base persistence model.


Use search with:

text
IssueNo
or
Title

Record one successful search.


36. Verify selection fields ​

Check the filter area for:

text
Priority
Status
ReportedOn
CurrencyCode

Record any differences caused by the current preview/UI layout.


37. Verify Currency value help ​

Open the value help for:

text
CurrencyCode

Confirm 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 = O

Issue.

Expected:

text
startProcessing available
close unavailable

Execute:

text
startProcessing

and verify:

text
Status = I

40. Re-check actions after state change ​

For:

text
Status = I

expected:

text
startProcessing unavailable
close available

This behavior should come from:

text
base feature control

not new UI code.


41. Execute close ​

Run:

text
close

Expected:

text
I → C

Verify final Status through the preview or a protected CDS read.


42. Verify dynamic field control ​

For:

text
Status = C

the cost fields should reflect Lesson 14 behavior:

text
EstimatedCost read-only
CurrencyCode read-only

Explain 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 EstimatedCost

Expected:

text
backend validation prevents invalid save
useful RAP message returned

44. Verify authorization ​

Use only an Issue whose:

text
ResponsibleUser = current user

for successful updates/actions.

Explain what should happen if:

text
state allows action
but current user is not authorized

45. Repair exercise — remove provider contract ​

Temporarily reason about omitting:

text
provider contract transactional_query

Restore it.

Explain why current projection modeling should specify its provider contract explicitly.


46. Repair exercise — remove root ​

Temporarily change:

text
define root view entity

to:

text
define view entity

Restore the correct root projection.

Explain the BO role lost by the incorrect declaration.


47. Repair exercise — omit projection action ​

Remove:

text
use action close

temporarily.

Activate and inspect the service behavior.

Restore it.

Explain:

text
base action exists
but service projection decides whether it is exposed

48. 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
Currencies

from 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 metadata

Where 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 Definition

You 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:

ProblemFirst 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.