C_MaterialDailyDemand

DDL: C_MATERIALDAILYDEMAND SQL: CMATDAILYDMND Type: view CONSUMPTION

Material Daily Demand

C_MaterialDailyDemand is a Consumption CDS View that provides data about "Material Daily Demand" in SAP S/4HANA. It reads from 3 data sources (I_MatlAvgDailyUsge1, P_DailyWeeklyMnthlyPIRHistDate, P_DailyWeeklyMnthlyPIRHistDate) and exposes 24 fields with key fields Material, Plant, MRPArea, PostingDate, Plant. It has 2 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_MatlAvgDailyUsge1 _AvgDailyUsage left_outer
P_DailyWeeklyMnthlyPIRHistDate _PIRHist from
P_DailyWeeklyMnthlyPIRHistDate _PIRHist union

Associations (2)

CardinalityTargetAliasCondition
[1..*] P_TimeDependentStockBuffer _ActualValues $projection.Material = _ActualValues.Material and $projection.Plant = _ActualValues.Plant and $projection.MRPArea = _ActualValues.MRPArea
[1..1] I_ProdBufLvlPrpslData _ProposalHeader $projection.Material = _ProposalHeader.Material and $projection.Plant = _ProposalHeader.Plant and $projection.MRPArea = _ProposalHeader.MRPArea and _ProposalHeader.ProposalEndDate = '99991231' and _ProposalHeader.ProposalStartDate <= $session.system_date

Annotations (9)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.sqlViewName CMATDAILYDMND view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Material Daily Demand view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (24)

KeyFieldSource TableSource FieldDescription
KEY Material _DemandDrivenProduct Material Vehicle Model
KEY Plant _DemandDrivenProduct Plant Prod plnt
KEY MRPArea _DemandDrivenProduct MRPArea MRP Area
KEY PostingDate I_MatlAvgDailyUsge1 PostingDate Delivery Date
CurrentAverageDailyUsage _ActualValues CurrentAvgDailyUsage
dec133endasPlndIndepRqmtQuantity
DailyPlndIndepRqmtQuantity
WeeklyPlndIndepRqmtQtyPerDay
MonthlyPlndIndepRqmtQtyPerDay
TotalWeeklyPlndIndepRqmtQty
TotalMonthlyPlndIndepRqmtQty
Material Vehicle Model
KEY Plant P_DailyWeeklyMnthlyPIRHistDate ProductionPlant Prod plnt
KEY MRPArea P_DailyWeeklyMnthlyPIRHistDate MRPArea MRP Area
KEY PostingDate DeliveryDate Delivery Date
CurrentAverageDailyUsage
PlndIndepRqmtQuantity
QuantityInBaseUnit
DailyPlndIndepRqmtQuantity
WeeklyPlndIndepRqmtQtyPerDay
MonthlyPlndIndepRqmtQtyPerDay
TotalWeeklyPlndIndepRqmtQty
TotalMonthlyPlndIndepRqmtQty
MaterialBaseUnit

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 C_MaterialDailyDemand.
-- 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: CMATDAILYDMND

CREATE VIEW C_MaterialDailyDemand AS
SELECT
  _DemandDrivenProduct.Material AS Material,
  _DemandDrivenProduct.Plant AS Plant,
  _DemandDrivenProduct.MRPArea AS MRPArea,
  _AvgDailyUsage.PostingDate AS PostingDate,
  _ActualValues.CurrentAvgDailyUsage AS CurrentAverageDailyUsage,
  case when (_AvgDailyUsage.PostingDate < _ProposalHeader.ProposalStartDate ) then cast(0 as abap.dec( 13, 3 )) end as PlndIndepRqmtQuantity AS dec133endasPlndIndepRqmtQuantity,
  cast(0 as abap.dec( 13, 3 )) AS DailyPlndIndepRqmtQuantity,
  cast(0 as abap.dec( 13, 3 )) AS WeeklyPlndIndepRqmtQtyPerDay,
  cast(0 as abap.dec( 13, 3 )) AS MonthlyPlndIndepRqmtQtyPerDay,
  cast(0 as abap.dec(13, 3)) AS TotalWeeklyPlndIndepRqmtQty,
  cast(0 as abap.dec(13, 3)) AS TotalMonthlyPlndIndepRqmtQty,
  sum(_PIRHist.QuantityInBaseUnit) AS PlndIndepRqmtQuantity,
  cast(0 as abap.dec( 13, 3 )) AS QuantityInBaseUnit,
  _ProposalHeader._BufMatPlant._Material.BaseUnit AS MaterialBaseUnit
FROM P_DailyWeeklyMnthlyPIRHistDate AS _PIRHist
LEFT OUTER JOIN I_MatlAvgDailyUsge1 AS _AvgDailyUsage ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_TimeDependentStockBuffer AS _ActualValues ON Material = _ActualValues.Material AND Plant = _ActualValues.Plant AND MRPArea = _ActualValues.MRPArea  -- association [1..*]
LEFT OUTER JOIN I_ProdBufLvlPrpslData AS _ProposalHeader ON Material = _ProposalHeader.Material AND Plant = _ProposalHeader.Plant AND MRPArea = _ProposalHeader.MRPArea AND _ProposalHeader.ProposalEndDate = '99991231' AND _ProposalHeader.ProposalStartDate <= $session.system_date  -- association [1..1]
-- UNION with additional select branch(es): P_DailyWeeklyMnthlyPIRHistDate
;