P_SlowMoMatPredCnsmpnDelta

DDL: P_SLOWMOMATPREDCNSMPNDELTA Type: view_entity COMPOSITE Package: ODATA_MM_IM_SLONOMOMAT

Consumption Delta

P_SlowMoMatPredCnsmpnDelta is a Composite CDS View that provides data about "Consumption Delta" in SAP S/4HANA. It reads from 2 data sources (I_Product, P_SlowMoMatPredCnsmpnFloat) and exposes 48 fields with key fields InventoryConsumptionGroup, CalendarMonth, Material, Plant, StockIdentifyingBatch. Part of development package ODATA_MM_IM_SLONOMOMAT.

Data Sources (2)

SourceAliasJoin Type
I_Product prod left_outer
P_SlowMoMatPredCnsmpnFloat 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 (48)

KeyFieldSource TableSource FieldDescription
KEY InventoryConsumptionGroup P_SlowMoMatPredCnsmpnFloat InventoryConsumptionGroup
KEY CalendarMonth P_SlowMoMatPredCnsmpnFloat CalendarMonth
KEY Material P_SlowMoMatPredCnsmpnFloat Material
KEY Plant P_SlowMoMatPredCnsmpnFloat Plant
KEY StockIdentifyingBatch P_SlowMoMatPredCnsmpnFloat StockIdentifyingBatch
KEY SpecialStockIdfgSupplier P_SlowMoMatPredCnsmpnFloat SpecialStockIdfgSupplier
KEY SpecialStockIdfgSalesOrder P_SlowMoMatPredCnsmpnFloat SpecialStockIdfgSalesOrder
KEY SpecialStockIdfgSalesOrderItem P_SlowMoMatPredCnsmpnFloat SpecialStockIdfgSalesOrderItem
KEY SpecialStockIdfgWBSElement P_SlowMoMatPredCnsmpnFloat SpecialStockIdfgWBSElement
KEY SpecialStockIdfgCustomer P_SlowMoMatPredCnsmpnFloat SpecialStockIdfgCustomer
KEY SpecialStockIdfgStockOwner P_SlowMoMatPredCnsmpnFloat SpecialStockIdfgStockOwner
KEY InventorySpecialStockType P_SlowMoMatPredCnsmpnFloat InventorySpecialStockType
KEY InventoryStockType P_SlowMoMatPredCnsmpnFloat InventoryStockType
KEY MaterialBaseUnit P_SlowMoMatPredCnsmpnFloat MaterialBaseUnit
ProductGroup I_Product ProductGroup
ProductType I_Product ProductType
ConsumptionQtyM1 P_SlowMoMatPredCnsmpnFloat ConsumptionQtyM1
ConsumptionQtyM2 P_SlowMoMatPredCnsmpnFloat ConsumptionQtyM2
ConsumptionQtyM3 P_SlowMoMatPredCnsmpnFloat ConsumptionQtyM3
ConsumptionQtyM4 P_SlowMoMatPredCnsmpnFloat ConsumptionQtyM4
ConsumptionQtyM5 P_SlowMoMatPredCnsmpnFloat ConsumptionQtyM5
ConsumptionQtyM6 P_SlowMoMatPredCnsmpnFloat ConsumptionQtyM6
ConsumptionQtyM7 P_SlowMoMatPredCnsmpnFloat ConsumptionQtyM7
target P_SlowMoMatPredCnsmpnFloat ConsumptionQtyM7
ConsumptionDeltaM2M1
ConsumptionDeltaM3M2
ConsumptionDeltaM4M3
ConsumptionDeltaM5M4
ConsumptionDeltaM6M5
NumberOfBomM5 P_SlowMoMatPredCnsmpnFloat NumberOfBomM5
NumberOfBomM6 P_SlowMoMatPredCnsmpnFloat NumberOfBomM6
NumberOfBomM7 P_SlowMoMatPredCnsmpnFloat NumberOfBomM7
NumberOfBomM8 P_SlowMoMatPredCnsmpnFloat NumberOfBomM8
NumberOfBomM9 P_SlowMoMatPredCnsmpnFloat NumberOfBomM9
NumberOfBomM10 P_SlowMoMatPredCnsmpnFloat NumberOfBomM10
NumberOfBomDeltaM6M5
NumberOfBomDeltaM7M6
NumberOfBomDeltaM8M7
NumberOfBomDeltaM9M8
NumberOfBomDeltaM10M9
NumberOfBomFloatM5endendasBomRatioM6M5
NumberOfBomFloatM6endendasBomRatioM7M6
NumberOfBomFloatM7endendasBomRatioM8M7
NumberOfBomFloatM8endendasBomRatioM9M8
NumberOfBomFloatM9endendasBomRatioM10M9
ConsumptionIntervalM1 0
ConsumptionIntervalM2
ConsumptionIntervalM3
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass:#TRANSACTIONAL
@VDM.private: true
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck:#NOT_REQUIRED
//@EndUserText.label: 'Consumption Delta'

define view entity P_SlowMoMatPredCnsmpnDelta as select from P_SlowMoMatPredCnsmpnFloat as rec
                                      left outer join I_Product                  as prod
                                                   on prod.Product = rec.Material    
   
                                            
{

  key rec.InventoryConsumptionGroup,
  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,
  
  
  //Consumption per Month 

  rec.ConsumptionQtyM1,
  rec.ConsumptionQtyM2,
  rec.ConsumptionQtyM3,
  rec.ConsumptionQtyM4,  
  rec.ConsumptionQtyM5,
  rec.ConsumptionQtyM6,
  rec.ConsumptionQtyM7,
  rec.ConsumptionQtyM7 as target, 
  
  //Consumption Delta from Month to previous Month

  cast(rec.ConsumptionQtyM2 - rec.ConsumptionQtyM1 as nsdm_consumption_quantity preserving type) as ConsumptionDeltaM2M1,
  cast(rec.ConsumptionQtyM3 - rec.ConsumptionQtyM2 as nsdm_consumption_quantity preserving type) as ConsumptionDeltaM3M2,   
  cast(rec.ConsumptionQtyM4 - rec.ConsumptionQtyM3 as nsdm_consumption_quantity preserving type) as ConsumptionDeltaM4M3, 
  cast(rec.ConsumptionQtyM5 - rec.ConsumptionQtyM4 as nsdm_consumption_quantity preserving type) as ConsumptionDeltaM5M4,   
  cast(rec.ConsumptionQtyM6 - rec.ConsumptionQtyM5 as nsdm_consumption_quantity preserving type) as ConsumptionDeltaM6M5, 
  
  //Ratio Consumption Delta Month to previous Month devided by Consumption of Pervious Month

  case when rec.ConsumptionDeltaFloatM2M1 = 0 then 0 else case when rec.ConsumptionQtyFloatM1 = 0 
       then 0 else rec.ConsumptionDeltaFloatM2M1 / rec.ConsumptionQtyFloatM1 end end as ConsumptionRatioM2M1,
  case when rec.ConsumptionDeltaFloatM3M2 = 0 then 0 else case when rec.ConsumptionQtyFloatM2 = 0 
       then 0 else rec.ConsumptionDeltaFloatM3M2 / rec.ConsumptionQtyFloatM2 end end as ConsumptionRatioM3M2,
  case when rec.ConsumptionDeltaFloatM4M3 = 0 then 0 else case when rec.ConsumptionQtyFloatM3 = 0 
       then 0 else rec.ConsumptionDeltaFloatM4M3 / rec.ConsumptionQtyFloatM3 end end as ConsumptionRatioM4M3,
  case when rec.ConsumptionDeltaFloatM5M4 = 0 then 0 else case when rec.ConsumptionQtyFloatM4 = 0 
       then 0 else rec.ConsumptionDeltaFloatM5M4 / rec.ConsumptionQtyFloatM4 end end as ConsumptionRatioM5M4,
  case when rec.ConsumptionDeltaFloatM6M5 = 0 then 0 else case when rec.ConsumptionQtyFloatM5 = 0 
       then 0 else rec.ConsumptionDeltaFloatM6M5 / rec.ConsumptionQtyFloatM5 end end as ConsumptionRatioM6M5,
    
  
  //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,              

  // Consumption Intervall as number of consecutive previous Month withour Consumption

  0 as ConsumptionIntervalM1,
  case when rec.ConsumptionQtyM1 > 0 then 0 else 1 end as ConsumptionIntervalM2,
  case when rec.ConsumptionQtyM2 > 0 then 0 else case when rec.ConsumptionQtyM1 > 0 then 1 else 2 end end as ConsumptionIntervalM3,
  case when rec.ConsumptionQtyM3 > 0 then 0 else case when rec.ConsumptionQtyM2 > 0 then 1
                                    else case when rec.ConsumptionQtyM1 > 0 then 2 else 3 end end end as ConsumptionIntervalM4,     
  case when rec.ConsumptionQtyM4 > 0 then 0 else case when rec.ConsumptionQtyM3 > 0 then 1  
                                        else case when rec.ConsumptionQtyM2 > 0 then 2
                                else case when rec.ConsumptionQtyM1 > 0 then 3 else 4 end end end end as ConsumptionIntervalM5, 
  case when rec.ConsumptionQtyM5 > 0 then 0 else case when rec.ConsumptionQtyM4 > 0 then 1  
                                        else case when rec.ConsumptionQtyM3 > 0 then 2
                                        else case when rec.ConsumptionQtyM2 > 0 then 3
                            else case when rec.ConsumptionQtyM1 > 0 then 4 else 5 end end end end end as ConsumptionIntervalM6                            
}