P_PurOrdMaintainHeaderDrfCalFs
P_PurOrdMaintainHeaderDrfCalFs is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (ekko_po_d) and exposes 3 fields with key field PurchaseOrderHeaderDraftUUID. It has 1 association to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| ekko_po_d | header | from |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..*] | ekpo_po_d | item | header.db_key = item.parent_key |
Annotations (4)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| AbapCatalog.sqlViewName | PPOMAINTHDRDRFCF | view | |
| AccessControl.authorizationCheck | #PRIVILEGED_ONLY | view |
Fields (3)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrderHeaderDraftUUID | ekko_po_d | guid | |
| netwrendasNetValue | ||||
| NumberOfItems |
// =========================================================================
// PO Maintenance: Calculated fields of Draft PO Header
// =========================================================================
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@AbapCatalog.sqlViewName: 'PPOMAINTHDRDRFCF'
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
define view P_PurOrdMaintainHeaderDrfCalFs
as select from ekko_po_d as header
association [1..*] to ekpo_po_d as item on header.db_key = item.parent_key
{
key header.guid as PurchaseOrderHeaderDraftUUID,
sum( case item.loekz
when 'L' then 0
when 'X' then 0
when 'S' then 0
else item.netwr
end ) as NetValue,
count( distinct item.ebelp ) as NumberOfItems //TO CLARIFY: Do we have to exclude deleted/statistical/return items???
}
group by header.guid
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"EKKO_PO_D",
"EKPO_PO_D"
],
"ASSOCIATED":
[
"EKPO_PO_D"
],
"BASE":
[],
"VERSION":0
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA