Give the business object a stable root
A request is the business object root; its items, if present, belong beneath it. A CDS root view entity describes the root data shape used by the RAP BO. It is not the persistence table and does not by itself enable create, update, or service access.
Project a small data model
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Purchase request'
define root view entity ZR_PURCHASE_REQUEST
as select from zpurchase_request
{
key request_id as RequestId,
status as Status,
requested_amount as RequestedAmount
}
zpurchase_request is a fictional project table. The key and element aliases become part of the BO’s data contract and are later used by its behavior and consumers. Choose stable names and semantics; don’t expose every persistence column by default.
#CHECK requests the applicable CDS access-control check. It is not a complete write-authorization design. ABAP Cloud also requires allowed/released repository dependencies. Check the target system for CDS feature availability and use ADT-generated artifacts as a starting point.
Sources
Developer practice · ABAP
Practice: project fields for a root entity
Write a project-owned root view entity that exposes a request key, status, and requested amount.
Complete the task using the syntax and structure described above. Variable names can differ if you use them consistently. This browser checker checks structure only; it does not compile or run ABAP.
0 required structures detected · 0 checks
Write your solution, then check its structure.
One possible solution
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Purchase request'
define root view entity ZR_PURCHASE_REQUEST
as select from zpurchase_request
{
key request_id as RequestId,
status as Status,
requested_amount as RequestedAmount
}