P_SlowMoMatPrMoStockDelta

DDL: P_SLOWMOMATPRMOSTOCKDELTA Type: view_entity COMPOSITE Package: ODATA_MM_IM_SLONOMOMAT

Stock Delta

P_SlowMoMatPrMoStockDelta is a Composite CDS View that provides data about "Stock Delta" in SAP S/4HANA. It reads from 2 data sources (I_Product, P_SlowMoMatPrMoStockFloat) and exposes 43 fields with key fields CalendarMonth, Material, Plant, MaterialBaseUnit. Part of development package ODATA_MM_IM_SLONOMOMAT.

Data Sources (2)

SourceAliasJoin Type
I_Product prod left_outer
P_SlowMoMatPrMoStockFloat rec from

Annotations (6)

NameValueLevelField
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.private true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (43)

KeyFieldSource TableSource FieldDescription
KEY CalendarMonth P_SlowMoMatPrMoStockFloat CalendarMonth Calendar Month
KEY Material P_SlowMoMatPrMoStockFloat Material Vehicle Model
KEY Plant P_SlowMoMatPrMoStockFloat Plant Valuation Area
KEY MaterialBaseUnit P_SlowMoMatPrMoStockFloat MaterialBaseUnit Valuation Unit
ProductGroup I_Product ProductGroup Product Sold Group
ProductType I_Product ProductType Product Type Group
StockQtyM1 P_SlowMoMatPrMoStockFloat StockQtyM1
StockQtyM2 P_SlowMoMatPrMoStockFloat StockQtyM2
StockQtyM3 P_SlowMoMatPrMoStockFloat StockQtyM3
StockQtyM4 P_SlowMoMatPrMoStockFloat StockQtyM4
StockQtyM5 P_SlowMoMatPrMoStockFloat StockQtyM5
StockQtyM6 P_SlowMoMatPrMoStockFloat StockQtyM6
StockQtyM7 P_SlowMoMatPrMoStockFloat StockQtyM7
target P_SlowMoMatPrMoStockFloat StockQtyM7
StockDeltaM2M1 P_SlowMoMatPrMoStockFloat StockDeltaM2M1
StockDeltaM3M2 P_SlowMoMatPrMoStockFloat StockDeltaM3M2
StockDeltaM4M3 P_SlowMoMatPrMoStockFloat StockDeltaM4M3
StockDeltaM5M4 P_SlowMoMatPrMoStockFloat StockDeltaM5M4
StockDeltaM6M5 P_SlowMoMatPrMoStockFloat StockDeltaM6M5
StockQtyM1endendasStockRatioM2M1
StockQtyM2endendasStockRatioM3M2
StockQtyM3endendasStockRatioM4M3
StockQtyM4endendasStockRatioM5M4
StockQtyM5endendasStockRatioM6M5
NumberOfBomM5 P_SlowMoMatPrMoStockFloat NumberOfBomM5
NumberOfBomM6 P_SlowMoMatPrMoStockFloat NumberOfBomM6
NumberOfBomM7 P_SlowMoMatPrMoStockFloat NumberOfBomM7
NumberOfBomM8 P_SlowMoMatPrMoStockFloat NumberOfBomM8
NumberOfBomM9 P_SlowMoMatPrMoStockFloat NumberOfBomM9
NumberOfBomM10 P_SlowMoMatPrMoStockFloat NumberOfBomM10
NumberOfBomDeltaM6M5 P_SlowMoMatPrMoStockFloat NumberOfBomDeltaM6M5
NumberOfBomDeltaM7M6 P_SlowMoMatPrMoStockFloat NumberOfBomDeltaM7M6
NumberOfBomDeltaM8M7 P_SlowMoMatPrMoStockFloat NumberOfBomDeltaM8M7
NumberOfBomDeltaM9M8 P_SlowMoMatPrMoStockFloat NumberOfBomDeltaM9M8
NumberOfBomDeltaM10M9 P_SlowMoMatPrMoStockFloat NumberOfBomDeltaM10M9
NumberOfBomM5endendasBomRatioM6M5
NumberOfBomM6endendasBomRatioM7M6
NumberOfBomM7endendasBomRatioM8M7
NumberOfBomM8endendasBomRatioM9M8
NumberOfBomM9endendasBomRatioM10M9
StockIntervalM1 0
StockIntervalM2
StockIntervalM3

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_SlowMoMatPrMoStockDelta.
-- 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_SlowMoMatPrMoStockDelta AS
SELECT
  rec.CalendarMonth AS CalendarMonth,
  rec.Material AS Material,
  rec.Plant AS Plant,
  rec.MaterialBaseUnit AS MaterialBaseUnit,
  prod.ProductGroup AS ProductGroup,
  prod.ProductType AS ProductType,
  rec.StockQtyM1 AS StockQtyM1,
  rec.StockQtyM2 AS StockQtyM2,
  rec.StockQtyM3 AS StockQtyM3,
  rec.StockQtyM4 AS StockQtyM4,
  rec.StockQtyM5 AS StockQtyM5,
  rec.StockQtyM6 AS StockQtyM6,
  rec.StockQtyM7 AS StockQtyM7,
  rec.StockQtyM7 AS target,
  rec.StockDeltaM2M1 AS StockDeltaM2M1,
  rec.StockDeltaM3M2 AS StockDeltaM3M2,
  rec.StockDeltaM4M3 AS StockDeltaM4M3,
  rec.StockDeltaM5M4 AS StockDeltaM5M4,
  rec.StockDeltaM6M5 AS StockDeltaM6M5,
  case when rec.StockDeltaM2M1 = 0 then 0 else case when rec.StockQtyM1 = 0 then 0 else rec.StockDeltaM2M1 / rec.StockQtyM1 end end as StockRatioM2M1 AS StockQtyM1endendasStockRatioM2M1,
  case when rec.StockDeltaM3M2 = 0 then 0 else case when rec.StockQtyM2 = 0 then 0 else rec.StockDeltaM3M2 / rec.StockQtyM2 end end as StockRatioM3M2 AS StockQtyM2endendasStockRatioM3M2,
  case when rec.StockDeltaM4M3 = 0 then 0 else case when rec.StockQtyM3 = 0 then 0 else rec.StockDeltaM4M3 / rec.StockQtyM3 end end as StockRatioM4M3 AS StockQtyM3endendasStockRatioM4M3,
  case when rec.StockDeltaM5M4 = 0 then 0 else case when rec.StockQtyM4 = 0 then 0 else rec.StockDeltaM5M4 / rec.StockQtyM4 end end as StockRatioM5M4 AS StockQtyM4endendasStockRatioM5M4,
  case when rec.StockDeltaM6M5 = 0 then 0 else case when rec.StockQtyM5 = 0 then 0 else rec.StockDeltaM6M5 / rec.StockQtyM5 end end as StockRatioM6M5 AS StockQtyM5endendasStockRatioM6M5,
  rec.NumberOfBomM5 AS NumberOfBomM5,
  rec.NumberOfBomM6 AS NumberOfBomM6,
  rec.NumberOfBomM7 AS NumberOfBomM7,
  rec.NumberOfBomM8 AS NumberOfBomM8,
  rec.NumberOfBomM9 AS NumberOfBomM9,
  rec.NumberOfBomM10 AS NumberOfBomM10,
  rec.NumberOfBomDeltaM6M5 AS NumberOfBomDeltaM6M5,
  rec.NumberOfBomDeltaM7M6 AS NumberOfBomDeltaM7M6,
  rec.NumberOfBomDeltaM8M7 AS NumberOfBomDeltaM8M7,
  rec.NumberOfBomDeltaM9M8 AS NumberOfBomDeltaM9M8,
  rec.NumberOfBomDeltaM10M9 AS NumberOfBomDeltaM10M9,
  case when rec.NumberOfBomDeltaM6M5 = 0 then 0 else case when rec.NumberOfBomM5 = 0 then 0 else rec.NumberOfBomDeltaM6M5 / rec.NumberOfBomM5 end end as BomRatioM6M5 AS NumberOfBomM5endendasBomRatioM6M5,
  case when rec.NumberOfBomDeltaM7M6 = 0 then 0 else case when rec.NumberOfBomM6 = 0 then 0 else rec.NumberOfBomDeltaM7M6 / rec.NumberOfBomM6 end end as BomRatioM7M6 AS NumberOfBomM6endendasBomRatioM7M6,
  case when rec.NumberOfBomDeltaM8M7 = 0 then 0 else case when rec.NumberOfBomM7 = 0 then 0 else rec.NumberOfBomDeltaM8M7 / rec.NumberOfBomM7 end end as BomRatioM8M7 AS NumberOfBomM7endendasBomRatioM8M7,
  case when rec.NumberOfBomDeltaM9M8 = 0 then 0 else case when rec.NumberOfBomM8 = 0 then 0 else rec.NumberOfBomDeltaM9M8 / rec.NumberOfBomM8 end end as BomRatioM9M8 AS NumberOfBomM8endendasBomRatioM9M8,
  case when rec.NumberOfBomDeltaM10M9 = 0 then 0 else case when rec.NumberOfBomM9 = 0 then 0 else rec.NumberOfBomDeltaM10M9 / rec.NumberOfBomM9 end end as BomRatioM10M9 AS NumberOfBomM9endendasBomRatioM10M9,
  0 AS StockIntervalM1,
  case when rec.StockDeltaM2M1 <> 0 then 0 else 1 end AS StockIntervalM2,
  case when rec.StockDeltaM3M2 <> 0 then 0 else case when rec.StockDeltaM2M1 <> 0 then 1 else 2 end end AS StockIntervalM3
FROM P_SlowMoMatPrMoStockFloat AS rec
LEFT OUTER JOIN I_Product AS prod ON /* join condition not captured in parsed metadata */
;