P_ContrHierItmDistrConsumption

DDL: P_CONTRHIERITMDISTRCONSUMPTION SQL: PHCTRITMDISTCNSM Type: view COMPOSITE

P_ContrHierItmDistrConsumption is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_ContrHierItmDistrCnsmdVal) and exposes 11 fields with key fields CentralPurchaseContract, CentralPurchaseContractItem, DistributionKey.

Data Sources (1)

SourceAliasJoin Type
P_ContrHierItmDistrCnsmdVal P_ContrHierItmDistrCnsmdVal from

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PHCTRITMDISTCNSM view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
VDM.private true view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (11)

KeyFieldSource TableSource FieldDescription
KEY CentralPurchaseContract CentralPurchaseContract Purchasing Doc.
KEY CentralPurchaseContractItem CentralPurchaseContractItem Item in Central Purchase Contract
KEY DistributionKey DistributionKey Distr. Number
PurchaseContractType PurchaseContractType Order Type
dec283endasContractConsumptionInPct
CntrlPurContractGRConsumption CntrlPurContractGRConsumption
dec283endasCntrlPurContrGRConsumptionPct
CntrlPurContractGRQuantity CntrlPurContractGRQuantity
CntrlPurContractGRAmount CntrlPurContractGRAmount
ReleaseOrderItemQuantityUnit ReleaseOrderItemQuantityUnit Order Unit
ReleaseOrderCurrency ReleaseOrderCurrency Currency

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_ContrHierItmDistrConsumption.
-- 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: PHCTRITMDISTCNSM

CREATE VIEW P_ContrHierItmDistrConsumption AS
SELECT
  CentralPurchaseContract,
  CentralPurchaseContractItem,
  DistributionKey,
  PurchaseContractType,
  case when TargetAmount <= 0.00 then 0 else cast ( ( division (ConsumedAmount, TargetAmount,3) * 100 ) as abap.dec( 28,3 ) ) end as ContractConsumptionInPct AS dec283endasContractConsumptionInPct,
  CntrlPurContractGRConsumption,
  case when TargetAmount <= 0.00 then 0 else cast( ( division( CntrlPurContractGRConsumption, TargetAmount, 3) * 100 ) as abap.dec( 28,3 ) ) end as CntrlPurContrGRConsumptionPct AS dec283endasCntrlPurContrGRConsumptionPct,
  CntrlPurContractGRQuantity,
  CntrlPurContractGRAmount,
  ReleaseOrderItemQuantityUnit,
  ReleaseOrderCurrency
FROM P_ContrHierItmDistrCnsmdVal
;