P_PlantAndStorLocWithStock

DDL: P_PLANTANDSTORLOCWITHSTOCK Type: view_entity COMPOSITE

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)

SourceAliasJoin Type
I_MaterialDocumentRecord I_MaterialDocumentRecord from
I_MaterialDocumentRecord I_MaterialDocumentRecord union

Annotations (6)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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":""
}
}*/