P_PhysInvtryActvStkSeparatSitn

DDL: P_PHYSINVTRYACTVSTKSEPARATSITN Type: view_entity COMPOSITE Package: ODATA_MM_IM_PI_OBJECT_PAGE

Active stock separators for PI Situation

P_PhysInvtryActvStkSeparatSitn is a Composite CDS View that provides data about "Active stock separators for PI Situation" in SAP S/4HANA. It reads from 2 data sources (P_PhysInvtryNotPostedMaterial, P_MaterialDocumentExtract) and exposes 37 fields with key fields Material, Plant, StorageLocation, Batch, Supplier. Part of development package ODATA_MM_IM_PI_OBJECT_PAGE.

Data Sources (2)

SourceAliasJoin Type
P_PhysInvtryNotPostedMaterial _NotPostedMaterial union_all
P_MaterialDocumentExtract StockSep from

Annotations (4)

NameValueLevelField
Metadata.ignorePropagatedAnnotations true view
AccessControl.authorizationCheck #NOT_ALLOWED view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (37)

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
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
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_PhysInvtryActvStkSeparatSitn.
-- 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.

CREATE VIEW P_PhysInvtryActvStkSeparatSitn 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,
  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
-- UNION ALL with additional select branch(es): P_PhysInvtryNotPostedMaterial
;