P_DDProductCalcFields

DDL: P_DDPRODUCTCALCFIELDS Type: view_entity COMPOSITE Package: PPH_DD_VDM_STLM

DD Product Calculated Fields

P_DDProductCalcFields is a Composite CDS View that provides data about "DD Product Calculated Fields" in SAP S/4HANA. It reads from 1 data source (I_DemandDrivenProduct1) and exposes 14 fields with key fields Material, Plant, MRPArea. It has 2 associations to related views. Part of development package PPH_DD_VDM_STLM.

Data Sources (1)

SourceAliasJoin Type
I_DemandDrivenProduct1 _DDProduct from

Associations (2)

CardinalityTargetAliasCondition
[1..1] I_ProfileAssgmtToPlant _ProfileAssign $projection.Plant = _ProfileAssign.Plant
[1..1] I_ProfileAssgmtToPlant _PlantDefaultThreshold _PlantDefaultThreshold.Plant = ''

Annotations (3)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (14)

KeyFieldSource TableSource FieldDescription
KEY Material Material Vehicle Model
KEY Plant Plant Valuation Area
KEY MRPArea MRPArea MRP Area
MRPAreaCategory I_MRPArea MRPAreaCategory
HorizonDaysInPast HorizonDaysInPast
HorizonDaysInFuture HorizonDaysInFuture
HorizonDaysPastInDcmlVal
HorizonDaysFutureInDcmlVal
DecoupledLeadTime DecoupledLeadTime
TotalNoOfDays
HorizonConstant
StartDate
EndDate
SpikeHorizonMultiplierendasSpikeHorizon

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_DDProductCalcFields.
-- 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.

CREATE VIEW P_DDProductCalcFields AS
SELECT
  Material,
  Plant,
  MRPArea,
  I_MRPArea.MRPAreaCategory AS MRPAreaCategory,
  HorizonDaysInPast,
  HorizonDaysInFuture,
  cast(HorizonDaysInPast as abap.dec(7,2)) AS HorizonDaysPastInDcmlVal,
  cast(HorizonDaysInFuture as abap.dec(7,2)) AS HorizonDaysFutureInDcmlVal,
  DecoupledLeadTime,
  cast( _DDProduct.HorizonDaysInPast as abap.int4) + cast( _DDProduct.HorizonDaysInFuture as abap.int4) AS TotalNoOfDays,
  cast(cast( 180 as abap.int4) as abap.dec(7,2)) AS HorizonConstant,
  DATS_ADD_DAYS(DATS_ADD_DAYS( cast($session.system_date as sydatum) ,(-1 * cast(_DDProduct.HorizonDaysInPast as abap.int4)),'FAIL'),0 ,'FAIL') AS StartDate,
  DATS_ADD_DAYS(DATS_ADD_DAYS( cast($session.system_date as sydatum) , (cast(_DDProduct.HorizonDaysInFuture as abap.int4) - 1),'FAIL'),0,'FAIL') AS EndDate,
  case when _ProfileAssign.Plant = Plant then _ProfileAssign.SpikeHorizonConstant + DecoupledLeadTime * _ProfileAssign.SpikeHorizonMultiplier else _PlantDefaultThreshold.SpikeHorizonConstant + DecoupledLeadTime * _PlantDefaultThreshold.SpikeHorizonMultiplier end as SpikeHorizon AS SpikeHorizonMultiplierendasSpikeHorizon
FROM I_DemandDrivenProduct1 AS _DDProduct
LEFT OUTER JOIN I_ProfileAssgmtToPlant AS _ProfileAssign ON Plant = _ProfileAssign.Plant  -- association [1..1]
LEFT OUTER JOIN I_ProfileAssgmtToPlant AS _PlantDefaultThreshold ON _PlantDefaultThreshold.Plant = ''  -- association [1..1]
;