@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass:#TRANSACTIONAL
@VDM.private: true
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck:#NOT_REQUIRED
//@EndUserText.label : 'Stock Delta'
define view entity P_SlowMoMatPredStockDelta as select from P_SlowMoMatPredStockFloat as rec
left outer join I_Product as prod
on prod.Product = rec.Material
{
key rec.CalendarMonth,
key rec.Material as Material,
key rec.Plant as Plant,
key rec.StockIdentifyingBatch,
key rec.SpecialStockIdfgSupplier,
key rec.SpecialStockIdfgSalesOrder,
key rec.SpecialStockIdfgSalesOrderItem,
key rec.SpecialStockIdfgWBSElement,
key rec.SpecialStockIdfgCustomer,
key rec.SpecialStockIdfgStockOwner,
key rec.InventorySpecialStockType,
key rec.InventoryStockType,
key rec.MaterialBaseUnit,
prod.ProductGroup as ProductGroup,
prod.ProductType as ProductType,
//Stock per Month
rec.StockQtyM1,
rec.StockQtyM2,
rec.StockQtyM3,
rec.StockQtyM4,
rec.StockQtyM5,
rec.StockQtyM6,
rec.StockQtyM7,
rec.StockQtyM7 as target,
//Stock Delta from Month to previous Month
rec.StockDeltaM2M1,
rec.StockDeltaM3M2,
rec.StockDeltaM4M3,
rec.StockDeltaM5M4,
rec.StockDeltaM6M5,
//Ratio Stock Delta Month to previous Month devided by Stock of Pervious Month
case when rec.StockDeltaFloatM2M1 = 0 then 0 else case when rec.StockQtyFloatM1 = 0
then 0 else rec.StockDeltaFloatM2M1 / rec.StockQtyFloatM1 end end as StockRatioM2M1,
case when rec.StockDeltaFloatM3M2 = 0 then 0 else case when rec.StockQtyFloatM2 = 0
then 0 else rec.StockDeltaFloatM3M2 / rec.StockQtyFloatM2 end end as StockRatioM3M2,
case when rec.StockDeltaFloatM4M3 = 0 then 0 else case when rec.StockQtyFloatM3 = 0
then 0 else rec.StockDeltaFloatM4M3 / rec.StockQtyFloatM3 end end as StockRatioM4M3,
case when rec.StockDeltaFloatM5M4 = 0 then 0 else case when rec.StockQtyFloatM4 = 0
then 0 else rec.StockDeltaFloatM5M4 / rec.StockQtyFloatM4 end end as StockRatioM5M4,
case when rec.StockDeltaFloatM6M5 = 0 then 0 else case when rec.StockQtyFloatM5 = 0
then 0 else rec.StockDeltaFloatM6M5 / rec.StockQtyFloatM5 end end as StockRatioM6M5,
//Number of BOMs used in per Month
rec.NumberOfBomM5,
rec.NumberOfBomM6,
rec.NumberOfBomM7,
rec.NumberOfBomM8,
rec.NumberOfBomM9,
rec.NumberOfBomM10,
//Number of BOMs Delta from Month to previous Month
cast (rec.NumberOfBomM6 - rec.NumberOfBomM5 as nsdm_number_of_bom_used_in preserving type) as NumberOfBomDeltaM6M5,
cast (rec.NumberOfBomM7 - rec.NumberOfBomM6 as nsdm_number_of_bom_used_in preserving type) as NumberOfBomDeltaM7M6,
cast (rec.NumberOfBomM8 - rec.NumberOfBomM7 as nsdm_number_of_bom_used_in preserving type) as NumberOfBomDeltaM8M7,
cast (rec.NumberOfBomM9 - rec.NumberOfBomM8 as nsdm_number_of_bom_used_in preserving type) as NumberOfBomDeltaM9M8,
cast (rec.NumberOfBomM10 - rec.NumberOfBomM9 as nsdm_number_of_bom_used_in preserving type) as NumberOfBomDeltaM10M9,
//Ratio Number of BOMs Delta Month to previous Month devided by Number of BOMs of Pervious Month
case when rec.NumberOfBomDeltaFloatM6M5 = 0 then 0 else case when rec.NumberOfBomFloatM5 = 0
then 0 else rec.NumberOfBomDeltaFloatM6M5 / rec.NumberOfBomFloatM5 end end as BomRatioM6M5,
case when rec.NumberOfBomDeltaFloatM7M6 = 0 then 0 else case when rec.NumberOfBomFloatM6 = 0
then 0 else rec.NumberOfBomDeltaFloatM7M6 / rec.NumberOfBomFloatM6 end end as BomRatioM7M6,
case when rec.NumberOfBomDeltaFloatM8M7 = 0 then 0 else case when rec.NumberOfBomFloatM7 = 0
then 0 else rec.NumberOfBomDeltaFloatM8M7 / rec.NumberOfBomFloatM7 end end as BomRatioM8M7,
case when rec.NumberOfBomDeltaFloatM9M8 = 0 then 0 else case when rec.NumberOfBomFloatM8 = 0
then 0 else rec.NumberOfBomDeltaFloatM9M8 / rec.NumberOfBomFloatM8 end end as BomRatioM9M8,
case when rec.NumberOfBomDeltaFloatM10M9 = 0 then 0 else case when rec.NumberOfBomFloatM9 = 0
then 0 else rec.NumberOfBomDeltaFloatM10M9 / rec.NumberOfBomFloatM9 end end as BomRatioM10M9,
// Stock Intervall as number of consecutive previous Month without Stock Change
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,
case when rec.StockDeltaM4M3 <> 0 then 0 else case when rec.StockDeltaM3M2 <> 0 then 1
else case when rec.StockDeltaM2M1 <> 0 then 2 else 3 end end end as StockIntervalM4,
case when rec.StockDeltaM5M4 <> 0 then 0 else case when rec.StockDeltaM4M3 <> 0 then 1
else case when rec.StockDeltaM3M2 <> 0 then 2
else case when rec.StockDeltaM2M1 <> 0 then 3 else 4 end end end end as StockIntervalM5,
case when rec.StockDeltaM6M5 <> 0 then 0 else case when rec.StockDeltaM5M4 <> 0 then 1
else case when rec.StockDeltaM4M3 <> 0 then 2
else case when rec.StockDeltaM3M2 <> 0 then 3
else case when rec.StockDeltaM2M1 <> 0 then 4 else 5 end end end end end as StockIntervalM6
}
Depth:
1
2
3
4
5
All
Reload
P_SlowMoMatPredStockDelta view_entity