I_MaterialStockRangeOfCoverage

DDL: I_MATERIALSTOCKRANGEOFCOVERAGE Type: view_entity COMPOSITE Package: MM_IM_VDM_STOCK

Range of Coverage Calculation

I_MaterialStockRangeOfCoverage is a Composite CDS View (Cube) that provides data about "Range of Coverage Calculation" in SAP S/4HANA. It reads from 1 data source (P_MaterialStockRoC2) and exposes 11 fields with key fields Material, Plant, MaterialBaseUnit. It has 4 associations to related views. Part of development package MM_IM_VDM_STOCK.

Data Sources (1)

SourceAliasJoin Type
P_MaterialStockRoC2 P_MaterialStockRoC2 from

Parameters (2)

NameTypeDefault
P_KeyDate sydate
P_NumberOfDays nsdm_roc_consideration_period

Associations (4)

CardinalityTargetAliasCondition
[1..1] I_Material _Material $projection.Material = _Material.Material
[1..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[1..1] I_PlantMaterialCount _PlantCount $projection.Plant = _PlantCount.Plant
[1..1] I_UnitOfMeasure _UnitOfMeasure $projection.MaterialBaseUnit = _UnitOfMeasure.UnitOfMeasure

Annotations (11)

NameValueLevelField
EndUserText.label Range of Coverage Calculation view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.private false view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
Analytics.dataCategory #CUBE view
Analytics.technicalName IMATSTOCKROC view
Metadata.allowExtensions true view

Fields (11)

KeyFieldSource TableSource FieldDescription
KEY Material Material Vehicle Model
KEY Plant RoC Plant Valuation Area
KEY MaterialBaseUnit MaterialBaseUnit Valuation Unit
MatlWrhsStkQtyInMatlBaseUnit MatlWrhsStkQtyInMatlBaseUnit Quantity
MatlCnsmpnQtyInMatlBaseUnit MatlCnsmpnQtyInMatlBaseUnit
P_NumberOfDays2endasMatlCnsmpnQtyAverage
dec183endasRangeOfCoverageInDays Quantity
_PlantCount _PlantCount
_Material _Material
_Plant _Plant
_UnitOfMeasure _UnitOfMeasure

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 I_MaterialStockRangeOfCoverage.
-- 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.
-- Parameters: P_KeyDate : sydate, P_NumberOfDays : nsdm_roc_consideration_period

CREATE VIEW I_MaterialStockRangeOfCoverage AS
SELECT
  Material,
  RoC.Plant AS Plant,
  MaterialBaseUnit,
  MatlWrhsStkQtyInMatlBaseUnit,
  MatlCnsmpnQtyInMatlBaseUnit,
  case $parameters.P_NumberOfDays when 0 then cast(0 as abap.dec(18,3)) else division(cast(MatlCnsmpnQtyInMatlBaseUnit as abap.dec(18,3)), $parameters.P_NumberOfDays, 2) end as MatlCnsmpnQtyAverage AS P_NumberOfDays2endasMatlCnsmpnQtyAverage,
  case when MatlWrhsStkQtyInMatlBaseUnit > 0 and MatlCnsmpnQtyInMatlBaseUnit > 0 then division(cast(MatlWrhsStkQtyInMatlBaseUnit as abap.dec(18,3)) * $parameters.P_NumberOfDays, cast(MatlCnsmpnQtyInMatlBaseUnit as abap.dec(18,3)), 2) else cast(0 as abap.dec(18,3)) end as RangeOfCoverageInDays AS dec183endasRangeOfCoverageInDays
FROM P_MaterialStockRoC2
LEFT OUTER JOIN I_Material AS _Material ON Material = _Material.Material  -- association [1..1]
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant  -- association [1..1]
LEFT OUTER JOIN I_PlantMaterialCount AS _PlantCount ON Plant = _PlantCount.Plant  -- association [1..1]
LEFT OUTER JOIN I_UnitOfMeasure AS _UnitOfMeasure ON MaterialBaseUnit = _UnitOfMeasure.UnitOfMeasure  -- association [1..1]
;