P_Materialaggr
Material Stock Calculation
P_Materialaggr is a Consumption CDS View that provides data about "Material Stock Calculation" in SAP S/4HANA. It reads from 1 data source (I_MaterialStock) and exposes 6 fields with key fields Material, Plant, StorageLocation, InventorySpecialStockType.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_MaterialStock | I_MaterialStock | from |
Annotations (4)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Material Stock Calculation | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view |
Fields (6)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Material | Material | ||
| KEY | Plant | Plant | ||
| KEY | StorageLocation | StorageLocation | ||
| KEY | InventorySpecialStockType | InventorySpecialStockType | ||
| MatlWrhsStkQtyInMatlBaseUnit | ||||
| MaterialBaseUnit | MaterialBaseUnit |
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Material Stock Calculation'
@VDM.viewType: #CONSUMPTION
@VDM.private: true
define view entity P_Materialaggr
as select from I_MaterialStock
{
key Material,
key Plant,
key StorageLocation,
key InventorySpecialStockType,
@DefaultAggregation : #SUM
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
sum(MatlWrhsStkQtyInMatlBaseUnit) as MatlWrhsStkQtyInMatlBaseUnit,
@DefaultAggregation : #SUM
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
sum(cast(case when MatlWrhsStkQtyInMatlBaseUnit > 0
then MatlWrhsStkQtyInMatlBaseUnit
else 0
end as nsdm_stock_qty)) as MatlWrhsStkQtyInMatlBaseUnitGZ,
MaterialBaseUnit
}
where
InventoryStockType = '01'
group by
Material,
Plant,
StorageLocation,
InventorySpecialStockType,
MaterialBaseUnit
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIALSTOCK"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
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