P_PlantAndStorLocWithStock
Plant and storage location with stock
P_PlantAndStorLocWithStock is a Composite CDS View that provides data about "Plant and storage location with stock" in SAP S/4HANA. It reads from 2 data sources (I_MaterialDocumentRecord, I_MaterialDocumentRecord) and exposes 14 fields with key fields Material, Plant, StorageLocation, Plant, StorageLocation.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_MaterialDocumentRecord | I_MaterialDocumentRecord | from |
| I_MaterialDocumentRecord | I_MaterialDocumentRecord | union |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | Plant and storage location with stock | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #P | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (14)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Material | Material | ||
| KEY | Plant | Plant | ||
| KEY | StorageLocation | StorageLocation | ||
| PlantName | _Plant | PlantName | ||
| StorageLocationName | _StorageLocation | StorageLocationName | ||
| MaterialBaseUnit | MaterialBaseUnit | |||
| UnrstrcdStkQuantityInBaseUnit | ||||
| KEY | Plant | Plant | ||
| KEY | StorageLocation | StorageLocation | ||
| PlantName | _Plant | PlantName | ||
| StorageLocationName | _StorageLocation | StorageLocationName | ||
| MaterialBaseUnit | MaterialBaseUnit | |||
| UnrstrcdStkQuantityInBaseUnit | ||||
| UnrstrcdCsgnmtStkQtyInBaseUnt |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Plant and storage location with stock'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #P
}
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view entity P_PlantAndStorLocWithStock
as select from I_MaterialDocumentRecord
{
key Material,
key Plant,
key StorageLocation,
_Plant.PlantName as PlantName,
_StorageLocation.StorageLocationName,
MaterialBaseUnit,
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
sum( cast( MatlStkChangeQtyInBaseUnit as nsdm_material_stock_in_buom) ) as UnrstrcdStkQuantityInBaseUnit,
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
sum( cast( 0 as nsdm_material_stock_in_buom ) ) as UnrstrcdCsgnmtStkQtyInBaseUnt
}
where
InventoryStockType = '01'
and InventorySpecialStockType = ''
group by
Material,
Plant,
_Plant.PlantName,
StorageLocation,
_StorageLocation.StorageLocationName,
MaterialBaseUnit
having
sum( MatlStkChangeQtyInBaseUnit ) > 0
union
select from I_MaterialDocumentRecord
{
key Material,
key Plant,
key StorageLocation,
_Plant.PlantName as PlantName,
_StorageLocation.StorageLocationName,
MaterialBaseUnit,
sum( cast( 0 as nsdm_material_stock_in_buom ) ) as UnrstrcdStkQuantityInBaseUnit,
sum( cast( MatlStkChangeQtyInBaseUnit as nsdm_material_stock_in_buom ) ) as UnrstrcdCsgnmtStkQtyInBaseUnt
}
where
InventoryStockType = '01'
and InventorySpecialStockType = 'K'
group by
Material,
Plant,
_Plant.PlantName,
StorageLocation,
_StorageLocation.StorageLocationName,
MaterialBaseUnit
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIALDOCUMENTRECORD",
"I_PLANT",
"I_STORAGELOCATION"
],
"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