P_MaterialKPIConsumptionStocks

DDL: P_MATERIALKPICONSUMPTIONSTOCKS SQL: PMATKPICONSSTK Type: view COMPOSITE

P_MaterialKPIConsumptionStocks is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_MaterialDocumentRecord, I_InvtryCnsmpnMvtType) and exposes 21 fields with key fields Material, Plant, StorageLocation, StockIdentifyingBatch, SpecialStockIdfgSupplier. It has 1 association to related views.

Data Sources (2)

SourceAliasJoin Type
I_MaterialDocumentRecord mat from
I_InvtryCnsmpnMvtType mtyp left_outer

Parameters (3)

NameTypeDefault
P_StartDate nsdm_reference_startdate
P_EndDate nsdm_reference_enddate
P_InventoryConsumptionGroup inventory_consumption_group

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_CurrentMatlPriceByCostEst _CurrentInvtryPrice $projection.CostEstimate = _CurrentInvtryPrice.CostEstimate

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PMATKPICONSSTK view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY Material StockIdentifyingMaterial
KEY Plant Plant
KEY StorageLocation StockIdfgStorageLocation
KEY StockIdentifyingBatch StockIdentifyingBatch
KEY SpecialStockIdfgSupplier SpecialStockIdfgSupplier
KEY SpecialStockIdfgSalesOrder SpecialStockIdfgSalesOrder
KEY SpecialStockIdfgSalesOrderItem SpecialStockIdfgSalesOrderItem
KEY SpecialStockIdfgWBSElement SpecialStockIdfgWBSElement
KEY SpecialStockIdfgCustomer SpecialStockIdfgCustomer
KEY SpecialStockIdfgStockOwner SpecialStockIdfgStockOwner
KEY InventorySpecialStockType InventorySpecialStockType
KEY InventoryStockType InventoryStockType
KEY MaterialBaseUnit MaterialBaseUnit
Currency CompanyCodeCurrency
CostEstimate CostEstimate
MatlStkChangeQtyInBaseUnit MatlStkChangeQtyInBaseUnit
MatlCnsmpnQtyInMatlBaseUnit MatlCnsmpnQtyInMatlBaseUnit
InventoryConsumptionGroup
PostingDate PostingDate
GoodsMovementType I_InvtryCnsmpnMvtType GoodsMovementType
_CurrentInvtryPrice _CurrentInvtryPrice
@AbapCatalog.sqlViewName: 'PMATKPICONSSTK'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED

@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ObjectModel: {
                 usageType:{
                              sizeCategory: #L,
                              serviceQuality: #D,
                              dataClass:#TRANSACTIONAL
                           }
              }

define view P_MaterialKPIConsumptionStocks 
  with parameters
    P_StartDate                 : nsdm_reference_startdate,
    P_EndDate                   : nsdm_reference_enddate,
    P_InventoryConsumptionGroup : inventory_consumption_group

as select from I_MaterialDocumentRecord as mat
    
  left outer join I_InvtryCnsmpnMvtType as mtyp on mtyp.InventoryConsumptionGroup = :P_InventoryConsumptionGroup
                                              and mat.GoodsMovementType          = mtyp.GoodsMovementType  
  association [0..1] to I_CurrentMatlPriceByCostEst as _CurrentInvtryPrice            on  $projection.CostEstimate = _CurrentInvtryPrice.CostEstimate
                                              {
  key StockIdentifyingMaterial  as Material,
  key Plant,
  key StockIdfgStorageLocation  as StorageLocation,
  key StockIdentifyingBatch,
  key SpecialStockIdfgSupplier,
  key SpecialStockIdfgSalesOrder,
  key SpecialStockIdfgSalesOrderItem,
  key SpecialStockIdfgWBSElement,
  key SpecialStockIdfgCustomer,
  key SpecialStockIdfgStockOwner,
  key InventorySpecialStockType,
  key InventoryStockType,
  key MaterialBaseUnit,
  CompanyCodeCurrency as Currency,
      CostEstimate,
      MatlStkChangeQtyInBaseUnit,
      
      MatlCnsmpnQtyInMatlBaseUnit,
      $parameters.P_InventoryConsumptionGroup as InventoryConsumptionGroup,
      PostingDate,
      mtyp.GoodsMovementType,
      
      _CurrentInvtryPrice
}     
where  PostingDate <= $parameters.P_EndDate and
       PostingDate >= $parameters.P_StartDate and
       ( InventoryStockType = '01' or 
       InventoryStockType = '02' or 
       InventoryStockType = '07' or
       InventoryStockType = '08' )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_INVTRYCNSMPNMVTTYPE",
"I_MATERIALDOCUMENTRECORD"
],
"ASSOCIATED":
[
"I_CURRENTMATLPRICEBYCOSTEST"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/