P_MaterialWarehouseStockCheck4

DDL: P_MATERIALWAREHOUSESTOCKCHECK4 SQL: PMATLWHSESTKCHK4 Type: view BASIC Package: MM_IM_VDM_CWM

Material Warehouse Stock Check

P_MaterialWarehouseStockCheck4 is a Basic CDS View that provides data about "Material Warehouse Stock Check" in SAP S/4HANA. It reads from 1 data source (P_MaterialWarehouseStockCheck2) and exposes 34 fields with key fields StockIdentifyingMaterial, Plant, StockIdfgStorageLocation, StockIdentifyingBatch, SpecialStockIdfgSupplier. It has 5 associations to related views. Part of development package MM_IM_VDM_CWM.

Data Sources (1)

SourceAliasJoin Type
P_MaterialWarehouseStockCheck2 P_MaterialWarehouseStockCheck2 from

Associations (5)

CardinalityTargetAliasCondition
[0..1] mara _CWM_MARA $projection.StockIdentifyingMaterial = _CWM_MARA.matnr
[0..1] tcwqtolgr _ToleranceGroup $projection.ToleranceGroup = _ToleranceGroup.cwqtolgr
[0..1] marv _CWM_MARV $projection.CompanyCode = _CWM_MARV.bukrs
[0..1] marm _CWM_UNIT $projection.StockIdentifyingMaterial = _CWM_UNIT.matnr and $projection.MaterialParallelUnit = _CWM_UNIT.meinh and _CWM_UNIT.ty2tq = 'A'
[0..1] I_InventoryStockTypeT _InventoryStockTypeT _InventoryStockTypeT.InventoryStockType = $projection.InventoryStockType and _InventoryStockTypeT.Language = $session.system_language

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PMATLWHSESTKCHK4 view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
VDM.private true view
VDM.viewType #BASIC view

Fields (34)

KeyFieldSource TableSource FieldDescription
KEY StockIdentifyingMaterial StockIdentifyingMaterial Stock Mat.
KEY Plant Plant Valuation Area
KEY StockIdfgStorageLocation StockIdfgStorageLocation Stor. Location SID
KEY StockIdentifyingBatch StockIdentifyingBatch Batch SID
KEY SpecialStockIdfgSupplier SpecialStockIdfgSupplier Supplier SID
KEY SpecialStockIdfgSalesOrder SpecialStockIdfgSalesOrder Stock Ident Header
KEY SpecialStockIdfgSalesOrderItem SpecialStockIdfgSalesOrderItem Stock Ident Item
KEY SpecialStockIdfgWBSElement SpecialStockIdfgWBSElement WBS Internal ID
KEY SpecialStockIdfgCustomer SpecialStockIdfgCustomer Customer SID
KEY SpecialStockIdfgStockOwner SpecialStockIdfgStockOwner Addl Supplier SID
KEY InventorySpecialStockType InventorySpecialStockType Special Stock Type
KEY InventoryStockType InventoryStockType Stock Type
KEY MaterialBaseUnit MaterialBaseUnit Valuation Unit
KEY MaterialParallelUnit MaterialParallelUnit
MatlStkQtyInBaseUnit MatlStkQtyInBaseUnit
MatlStkQtyInParUnit MatlStkQtyInParUnit
PUoMNumerator
BUoMNumerator
Percent
_ToleranceGroup _ToleranceGroup
LowDevitionErrorThreshold
LowThresholdSigned
HighDevitionErrorThreshold
CostEstimate CostEstimate Cost EstimateNo
CompanyCode CompanyCode Receiver Company Code
Batch Batch Lot No.
InventoryStockTypeName _InventoryStockTypeT InventoryStockTypeName
LastPostingDate LastPostingDate
FiscalYearVariant FiscalYearVariant FY Variant
LastPostingPeriod LastPostingPeriod
NumberOfDaysSinceLastMovement
TodayDate TodayDate
CurrentPostingPeriod
PreviousPostingPeriod

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_MaterialWarehouseStockCheck4.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PMATLWHSESTKCHK4

CREATE VIEW P_MaterialWarehouseStockCheck4 AS
SELECT
  StockIdentifyingMaterial,
  Plant,
  StockIdfgStorageLocation,
  StockIdentifyingBatch,
  SpecialStockIdfgSupplier,
  SpecialStockIdfgSalesOrder,
  SpecialStockIdfgSalesOrderItem,
  SpecialStockIdfgWBSElement,
  SpecialStockIdfgCustomer,
  SpecialStockIdfgStockOwner,
  InventorySpecialStockType,
  InventoryStockType,
  MaterialBaseUnit,
  MaterialParallelUnit,
  MatlStkQtyInBaseUnit,
  MatlStkQtyInParUnit,
  cast( _CWM_UNIT.umrez as umrez preserving type ) AS PUoMNumerator,
  cast( _CWM_UNIT.umren as umren preserving type ) AS BUoMNumerator,
  cast ('%' as /cwm/percent) AS Percent,
  cast( $parameters.P_LowDevitionErrorThreshold as /cwm/lowdevitionerrorthld preserving type) AS LowDevitionErrorThreshold,
  cast(- $parameters.P_LowDevitionErrorThreshold as /cwm/lowdevitionerrorthld_s preserving type) AS LowThresholdSigned,
  cast( $parameters.P_HighDevitionErrorThreshold as /cwm/highdevitionerrorthld preserving type) AS HighDevitionErrorThreshold,
  CostEstimate,
  CompanyCode,
  Batch,
  _InventoryStockTypeT.InventoryStockTypeName AS InventoryStockTypeName,
  LastPostingDate,
  FiscalYearVariant,
  LastPostingPeriod,
  cast(dats_days_between(LastPostingDate, TodayDate ) as nsdm_numofdaysinceposting preserving type ) AS NumberOfDaysSinceLastMovement,
  TodayDate,
  cast(concat(_CWM_MARV.lfgja, concat('0',_CWM_MARV.lfmon)) as /cwm/current_period) AS CurrentPostingPeriod,
  cast(concat(_CWM_MARV.vmgja, concat('0',_CWM_MARV.vmmon)) as /cwm/previous_period) AS PreviousPostingPeriod
FROM P_MaterialWarehouseStockCheck2
LEFT OUTER JOIN mara AS _CWM_MARA ON StockIdentifyingMaterial = _CWM_MARA.matnr  -- association [0..1]
LEFT OUTER JOIN tcwqtolgr AS _ToleranceGroup ON ToleranceGroup = _ToleranceGroup.cwqtolgr  -- association [0..1]
LEFT OUTER JOIN marv AS _CWM_MARV ON CompanyCode = _CWM_MARV.bukrs  -- association [0..1]
LEFT OUTER JOIN marm AS _CWM_UNIT ON StockIdentifyingMaterial = _CWM_UNIT.matnr AND MaterialParallelUnit = _CWM_UNIT.meinh AND _CWM_UNIT.ty2tq = 'A'  -- association [0..1]
LEFT OUTER JOIN I_InventoryStockTypeT AS _InventoryStockTypeT ON _InventoryStockTypeT.InventoryStockType = InventoryStockType AND _InventoryStockTypeT.Language = $session.system_language  -- association [0..1]
;