P_DEADSTKMVMBASE

DDL: P_DEADSTKMVMBASE Type: view_entity COMPOSITE Package: ODATA_MM_IM_DEADTSTOCKMAT

Dead stock movement base data calculation

P_DEADSTKMVMBASE is a Composite CDS View that provides data about "Dead stock movement base data calculation" in SAP S/4HANA. It reads from 1 data source (I_MaterialDocumentRecord) and exposes 16 fields with key fields Material, Plant, StorageLocation, StockIdentifyingBatch, SpecialStockIdfgSupplier. Part of development package ODATA_MM_IM_DEADTSTOCKMAT.

Data Sources (1)

SourceAliasJoin Type
I_MaterialDocumentRecord I_MaterialDocumentRecord from

Parameters (2)

NameTypeDefault
P_StartDate nsdm_reference_date
P_EndDate nsdm_reference_date

Annotations (6)

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

Fields (16)

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
KEY Currency CompanyCodeCurrency
MatlCnsmpnQtyInMatlBaseUnit
MatlDocLatestPostgDate
@ObjectModel:
              { 
                usageType:
                          {
                            sizeCategory: #XXL,
                            serviceQuality: #D,
                            dataClass:#TRANSACTIONAL
                          }
              }
@VDM:
      {
        viewType: #COMPOSITE,
        private: true
      }
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view entity P_DEADSTKMVMBASE 
with parameters
    P_StartDate : nsdm_reference_date,
    P_EndDate   : nsdm_reference_date
  as select from I_MaterialDocumentRecord
{
  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,
  key CompanyCodeCurrency as Currency,
      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      sum(MatlCnsmpnQtyInMatlBaseUnit)                  as MatlCnsmpnQtyInMatlBaseUnit,
      max( case when  MatlCnsmpnQtyInMatlBaseUnit <> 0
           then PostingDate
                else cast( '00000000' as budat)
           end)                                         as CnsmpnLatestPostgDate,
      max( PostingDate )                                as MatlDocLatestPostgDate
}
where
  PostingDate >= $parameters.P_StartDate and PostingDate <= $parameters.P_EndDate
group by
  StockIdentifyingMaterial,
  Plant,
  StockIdfgStorageLocation,
  StockIdentifyingBatch,
  SpecialStockIdfgSupplier,
  SpecialStockIdfgSalesOrder,
  SpecialStockIdfgSalesOrderItem,
  SpecialStockIdfgWBSElement,
  SpecialStockIdfgCustomer,
  SpecialStockIdfgStockOwner,
  InventorySpecialStockType,
  InventoryStockType,
  MaterialBaseUnit,
  CompanyCodeCurrency