P_PhysInvtryActvStkSeparator

DDL: P_PHYSINVTRYACTVSTKSEPARATOR SQL: PPIACTVSTOCKSEP Type: view COMPOSITE

P_PhysInvtryActvStkSeparator is a Composite CDS View in SAP S/4HANA. It reads from 4 data sources (P_PhysInvtryNotPostedMaterial, P_MappedPhysInvtryItem, P_MappedPhysInvtryItem, P_MaterialDocumentExtract) and exposes 43 fields with key fields Material, Plant, StorageLocation, Batch, Supplier. It has 1 association to related views.

Data Sources (4)

SourceAliasJoin Type
P_PhysInvtryNotPostedMaterial _NotPostedMaterial union_all
P_MappedPhysInvtryItem PiItem left_outer
P_MappedPhysInvtryItem PiItem left_outer
P_MaterialDocumentExtract StockSep from

Associations (1)

CardinalityTargetAliasCondition
[0..1] P_PhysInvtryKeyFiguresBase _KeyFigures _KeyFigures.Material = $projection.Material and _KeyFigures.Plant = $projection.Plant and _KeyFigures.StorageLocation = $projection.StorageLocation and _KeyFigures.Batch = $projection.Batch and _KeyFigures.Supplier = $projection.Supplier and _KeyFigures.SalesOrder = $projection.SalesOrder and _KeyFigures.SalesOrderItem = $projection.SalesOrderItem and _KeyFigures.WBSElementInternalID = $projection.WBSElementInternalID and _KeyFigures.Customer = $projection.Customer and _KeyFigures.StockOwner = $projection.StockOwner and _KeyFigures.InventoryStockType = $projection.InventoryStockType and _KeyFigures.InventorySpecialStockType = $projection.InventorySpecialStockType and _KeyFigures.MaterialBaseUnit = $projection.MaterialBaseUnit

Annotations (7)

NameValueLevelField
AbapCatalog.preserveKey true view
AbapCatalog.sqlViewName PPIACTVSTOCKSEP view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_ALLOWED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (43)

KeyFieldSource TableSource FieldDescription
KEY Material
KEY Plant P_MaterialDocumentExtract Plant Valuation Area
KEY StorageLocation StorageLocation
KEY Batch Lot No.
KEY Supplier Supplier
KEY SalesOrder SD Document
KEY SalesOrderItem Sales Order Item
KEY WBSElementInternalID P_MaterialDocumentExtract SpecialStockIdfgWBSElement WBS Internal ID
KEY Customer Sold-to Party
KEY StockOwner Owner of stock
KEY InventoryStockType P_MaterialDocumentExtract InventoryStockType Stock Type
KEY InventorySpecialStockType P_MaterialDocumentExtract InventorySpecialStockType Special Stock Type
KEY MaterialBaseUnit P_MaterialDocumentExtract MaterialBaseUnit Unit of Measure
KEY MaterialIsPostedToStock
CycleCountType
CycleCountingIndicatorIsFixed
ProductType
ProductGroup
MatlWrhsStkQtyInMatlBaseUnit
PhysicalInventoryLastCountDate
NumberOfPhysInventoryCounts
Material
KEY Plant P_PhysInvtryNotPostedMaterial Plant Valuation Area
KEY StorageLocation P_PhysInvtryNotPostedMaterial StorageLocation StorageLocation
KEY Batch P_PhysInvtryNotPostedMaterial Batch Lot No.
KEY Supplier P_PhysInvtryNotPostedMaterial Supplier Supplier
KEY SalesOrder P_PhysInvtryNotPostedMaterial SalesOrder SD Document
KEY SalesOrderItem P_PhysInvtryNotPostedMaterial SalesOrderItem Sales Order Item
KEY WBSElementInternalID P_PhysInvtryNotPostedMaterial WBSElementInternalID WBS Internal ID
KEY Customer P_PhysInvtryNotPostedMaterial Customer Sold-to Party
KEY StockOwner P_PhysInvtryNotPostedMaterial StockOwner Owner of stock
KEY InventoryStockType P_PhysInvtryNotPostedMaterial InventoryStockType Stock Type
KEY InventorySpecialStockType Special Stock Type
KEY MaterialBaseUnit prod BaseUnit Unit of Measure
KEY MaterialIsPostedToStock
CycleCountType
CycleCountingIndicatorIsFixed
ProductType
ProductGroup
MatlWrhsStkQtyInMatlBaseUnit
PhysicalInventoryLastCountDate
NumberOfPhysInventoryCounts
CurrentDate

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_PhysInvtryActvStkSeparator.
-- 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: PPIACTVSTOCKSEP

CREATE VIEW P_PhysInvtryActvStkSeparator AS
SELECT
  cast(StockSep.StockIdentifyingMaterial as matnr preserving type) AS Material,
  StockSep.Plant AS Plant,
  cast(StockSep.StockIdfgStorageLocation as lgort_d preserving type) AS StorageLocation,
  cast(StockSep.StockIdentifyingBatch as charg_d preserving type) AS Batch,
  cast(StockSep.SpecialStockIdfgSupplier as elifn preserving type) AS Supplier,
  cast(StockSep.SpecialStockIdfgSalesOrder as kdauf preserving type) AS SalesOrder,
  cast(StockSep.SpecialStockIdfgSalesOrderItem as pi_sales_order_item preserving type) AS SalesOrderItem,
  StockSep.SpecialStockIdfgWBSElement AS WBSElementInternalID,
  cast(StockSep.SpecialStockIdfgCustomer as ekunn preserving type) AS Customer,
  cast(StockSep.SpecialStockIdfgStockOwner as pi_owner_of_stock preserving type) AS StockOwner,
  StockSep.InventoryStockType AS InventoryStockType,
  StockSep.InventorySpecialStockType AS InventorySpecialStockType,
  StockSep.MaterialBaseUnit AS MaterialBaseUnit,
  cast( 'X' as materialispostedtostock preserving type ) AS MaterialIsPostedToStock,
  max(ProdPlant.InventoryForCycleCountInd) AS CycleCountType,
  max(ProdPlant.CycleCountingIndicatorIsFixed) AS CycleCountingIndicatorIsFixed,
  max(prod.ProductType) AS ProductType,
  max(prod.ProductGroup) AS ProductGroup,
  cast(sum(StockSep.MatlStkChangeQtyInBaseUnit) as nsdm_stock_qty ) AS MatlWrhsStkQtyInMatlBaseUnit,
  max(_KeyFigures.PhysicalInventoryLastCountDate) AS PhysicalInventoryLastCountDate,
  max(_KeyFigures.NumberOfPhysInventoryCounts) AS NumberOfPhysInventoryCounts,
  $session.system_date AS CurrentDate
FROM P_MaterialDocumentExtract AS StockSep
LEFT OUTER JOIN P_MappedPhysInvtryItem AS PiItem ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_PhysInvtryKeyFiguresBase AS _KeyFigures ON _KeyFigures.Material = Material AND _KeyFigures.Plant = Plant AND _KeyFigures.StorageLocation = StorageLocation AND _KeyFigures.Batch = Batch AND _KeyFigures.Supplier = Supplier AND _KeyFigures.SalesOrder = SalesOrder AND _KeyFigures.SalesOrderItem = SalesOrderItem AND _KeyFigures.WBSElementInternalID = WBSElementInternalID AND _KeyFigures.Customer = Customer AND _KeyFigures.StockOwner = StockOwner AND _KeyFigures.InventoryStockType = InventoryStockType AND _KeyFigures.InventorySpecialStockType = InventorySpecialStockType AND _KeyFigures.MaterialBaseUnit = MaterialBaseUnit  -- association [0..1]
-- UNION ALL with additional select branch(es): P_PhysInvtryNotPostedMaterial
;