P_MatStkQtyValByKeyDateMid

DDL: P_MATSTKQTYVALBYKEYDATEMID SQL: PMATSTKQTYVALM Type: view COMPOSITE

P_MatStkQtyValByKeyDateMid is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (P_MatStkQtyValByKeyDateBase, P_MatStkQtyValByKeyDateBase) and exposes 35 fields with key fields Material, Plant, StorageLocation, Batch, Supplier.

Data Sources (2)

SourceAliasJoin Type
P_MatStkQtyValByKeyDateBase P_MatStkQtyValByKeyDateBase from
P_MatStkQtyValByKeyDateBase P_MatStkQtyValByKeyDateBase union_all

Parameters (1)

NameTypeDefault
P_KeyDate calendardate

Annotations (10)

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

Fields (35)

KeyFieldSource TableSource FieldDescription
KEY Material Main Material Vehicle Model
KEY Plant Plant Valuation Area
KEY StorageLocation StorageLocation StorageLocation
KEY Batch Batch Lot No.
KEY Supplier Supplier Supplier
KEY SDDocument SDDocument SD Document
KEY SDDocumentItem SDDocumentItem
KEY WBSElementInternalID WBSElementInternalID WBS Internal ID
KEY Customer Customer Sold-to Party
KEY SpecialStockIdfgStockOwner SpecialStockIdfgStockOwner
KEY InventoryStockType InventoryStockType Stock Type
KEY InventorySpecialStockType InventorySpecialStockType Special Stock Type
KEY MaterialBaseUnit MaterialBaseUnit Valuation Unit
KEY ValuationAreaType
CostEstimate
MatlWrhsStkQtyInMatlBaseUnit MatlWrhsStkQtyInMatlBaseUnit Quantity
dec182asStockValueInCCCrcy Quantity
Material Vehicle Model
KEY Plant Plant Valuation Area
KEY StorageLocation StorageLocation StorageLocation
KEY Batch Batch Lot No.
KEY Supplier Supplier Supplier
KEY SDDocument SDDocument SD Document
KEY SDDocumentItem SDDocumentItem
KEY WBSElementInternalID WBSElementInternalID WBS Internal ID
KEY Customer Customer Sold-to Party
KEY SpecialStockIdfgStockOwner SpecialStockIdfgStockOwner
KEY InventoryStockType InventoryStockType Stock Type
KEY InventorySpecialStockType InventorySpecialStockType Special Stock Type
KEY MaterialBaseUnit MaterialBaseUnit Valuation Unit
KEY ValuationAreaType
CostEstimate
MatlWrhsStkQtyInMatlBaseUnit MatlWrhsStkQtyInMatlBaseUnit Quantity
dec182asStockValueInCCCrcy Quantity
Currency _CompanyCode Currency Valuation Crcy

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_MatStkQtyValByKeyDateMid.
-- 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: PMATSTKQTYVALM
-- Parameters: P_KeyDate : calendardate

CREATE VIEW P_MatStkQtyValByKeyDateMid AS
SELECT
  Main.Material AS Material,
  Plant,
  StorageLocation,
  Batch,
  Supplier,
  SDDocument,
  SDDocumentItem,
  WBSElementInternalID,
  Customer,
  SpecialStockIdfgStockOwner,
  InventoryStockType,
  InventorySpecialStockType,
  MaterialBaseUnit,
  cast('1' as bwkrs_cus) AS ValuationAreaType,
  MatlWrhsStkQtyInMatlBaseUnit,
  cast( round( cast(MatlWrhsStkQtyInMatlBaseUnit as abap.dec( 21, 3 )) * division( cast(_CurrentInvtryPrice.InventoryPrice as abap.dec( 11, 2 )), cast(_CurrentInvtryPrice.MaterialPriceUnitQty as abap.dec( 5, 0 )), 5 ) , 2 ) as abap.dec( 18, 2 ) ) as StockValueInCCCrcy AS dec182asStockValueInCCCrcy,
  _CompanyCode.Currency AS Currency
FROM P_MatStkQtyValByKeyDateBase
-- UNION ALL with additional select branch(es): P_MatStkQtyValByKeyDateBase
;