P_PurOrdMaintainHeaderDrfCalFs

DDL: P_PURORDMAINTAINHEADERDRFCALFS SQL: PPOMAINTHDRDRFCF Type: view CONSUMPTION Package: ODATA_MM_PUR_PO_MAINTAIN

PO Maintenance: Calculated fields of Draft PO Header

P_PurOrdMaintainHeaderDrfCalFs is a Consumption CDS View that provides data about "PO Maintenance: Calculated fields of Draft PO Header" 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. Part of development package ODATA_MM_PUR_PO_MAINTAIN.

Data Sources (1)

SourceAliasJoin Type
ekko_po_d header from

Associations (1)

CardinalityTargetAliasCondition
[1..*] ekpo_po_d item header.db_key = item.parent_key

Annotations (4)

NameValueLevelField
VDM.viewType #CONSUMPTION view
VDM.private true view
AbapCatalog.sqlViewName PPOMAINTHDRDRFCF view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view

Fields (3)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrderHeaderDraftUUID ekko_po_d guid UUID 22 char.
netwrendasNetValue
NumberOfItems

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_PurOrdMaintainHeaderDrfCalFs.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PPOMAINTHDRDRFCF

CREATE VIEW P_PurOrdMaintainHeaderDrfCalFs AS
SELECT
  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 AS netwrendasNetValue,
  count( distinct item.ebelp ) AS NumberOfItems
FROM ekko_po_d AS header
LEFT OUTER JOIN ekpo_po_d AS item ON header.db_key = item.parent_key  -- association [1..*]
;