P_BatchMaterialStockValuation

DDL: P_BATCHMATERIALSTOCKVALUATION Type: view_entity COMPOSITE Package: LO_BM_BATCH_DB_SUPP

Latest Material Stock with Valuation - Aggregated

P_BatchMaterialStockValuation is a Composite CDS View that provides data about "Latest Material Stock with Valuation - Aggregated" in SAP S/4HANA. It reads from 2 data sources (I_MaterialStock_2, I_MaterialValuation) and exposes 15 fields with key fields Material, Plant, StorageLocation, Batch, Supplier. Part of development package LO_BM_BATCH_DB_SUPP.

Data Sources (2)

SourceAliasJoin Type
I_MaterialStock_2 _MaterialStock from
I_MaterialValuation _MatValuation inner

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
VDM.private true view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #NONE view

Fields (15)

KeyFieldSource TableSource FieldDescription
KEY Material I_MaterialStock_2 Material
KEY Plant I_MaterialStock_2 Plant
KEY StorageLocation I_MaterialStock_2 StorageLocation
KEY Batch I_MaterialStock_2 Batch
KEY Supplier I_MaterialStock_2 Supplier
KEY SDDocument I_MaterialStock_2 SDDocument
KEY SDDocumentItem I_MaterialStock_2 SDDocumentItem
KEY WBSElementInternalID I_MaterialStock_2 WBSElementInternalID
KEY Customer I_MaterialStock_2 Customer
KEY SpecialStockIdfgStockOwner I_MaterialStock_2 SpecialStockIdfgStockOwner
KEY InventoryStockType I_MaterialStock_2 InventoryStockType
KEY InventorySpecialStockType I_MaterialStock_2 InventorySpecialStockType
KEY InventoryValuationType I_MaterialValuation InventoryValuationType
KEY MaterialBaseUnit I_MaterialStock_2 MaterialBaseUnit
TotalMaterialStockQuantity
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
  serviceQuality: #C,
  sizeCategory: #XXL,
  dataClass: #MIXED
}
@VDM.private: true
@VDM.viewType: #COMPOSITE
@VDM.lifecycle.contract.type: #NONE

define view entity P_BatchMaterialStockValuation
  as select from I_MaterialStock_2   as _MaterialStock
    inner join   I_MaterialValuation as _MatValuation on _MatValuation.CostEstimate = _MaterialStock.CostEstimate
{
  key _MaterialStock.Material,
  key _MaterialStock.Plant,
  key _MaterialStock.StorageLocation,
  key _MaterialStock.Batch,
  key _MaterialStock.Supplier,
  key _MaterialStock.SDDocument,
  key _MaterialStock.SDDocumentItem,
  key _MaterialStock.WBSElementInternalID,
  key _MaterialStock.Customer,
  key _MaterialStock.SpecialStockIdfgStockOwner,
  key _MaterialStock.InventoryStockType,
  key _MaterialStock.InventorySpecialStockType,
  key _MatValuation.InventoryValuationType,
  key _MaterialStock.MaterialBaseUnit,

      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      sum(_MaterialStock.MatlWrhsStkQtyInMatlBaseUnit) as TotalMaterialStockQuantity
}
where _MaterialStock.CostEstimate is not initial
group by
  _MaterialStock.Material,
  _MaterialStock.Plant,
  _MaterialStock.StorageLocation,
  _MaterialStock.Batch,
  _MaterialStock.Supplier,
  _MaterialStock.SDDocument,
  _MaterialStock.SDDocumentItem,
  _MaterialStock.WBSElementInternalID,
  _MaterialStock.Customer,
  _MaterialStock.SpecialStockIdfgStockOwner,
  _MaterialStock.InventoryStockType,
  _MaterialStock.InventorySpecialStockType,
  _MatValuation.InventoryValuationType,
  _MaterialStock.MaterialBaseUnit
having
  sum(_MaterialStock.MatlWrhsStkQtyInMatlBaseUnit) <> 0