cds-view-entitieslisted
Install: claude install-skill williamcorrea23/sap-router-skill
# CDS View Entities
Guide for building semantic data models using ABAP CDS (Core Data Services) view entities in ABAP Cloud.
## Workflow
1. **Determine the user's goal**:
- Creating a new data model (standalone or for RAP)
- Defining relationships between entities (associations, compositions)
- Adding annotations for UI, semantics, or analytics
- Implementing access controls
- Using expressions, functions, or parameters in CDS
2. **Identify the context**:
- Standalone CDS view vs. RAP BO data model
- Root entity vs. child entity vs. projection view
- Transactional (RAP) vs. analytical vs. read-only consumption
3. **Apply best practices**:
- Use CDS view entities (v2 syntax `define view entity`) — not legacy CDS views (`define view`)
- Follow naming conventions (e.g., `ZR_*` for interface/BO views, `ZC_*` for consumption/projection views, `ZI_*` for reuse views)
- Add appropriate annotations for metadata consumers (UI, OData, analytics)
## CDS View Entity Syntax
### Basic View Entity
```cds
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales Order'
define view entity ZI_SalesOrder
as select from zsalesorder
{
key order_id as OrderId,
customer_id as CustomerId,
order_date as OrderDate,
net_amount as NetAmount,
currency_code as CurrencyCode,
status as Status,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_at as LastChange