P_BatchMaterialStockValuation
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)
| Source | Alias | Join Type |
|---|---|---|
| I_MaterialStock_2 | _MaterialStock | from |
| I_MaterialValuation | _MatValuation | inner |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA