P_PhysInvtryActvStkSeparator
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)
| Source | Alias | Join Type |
|---|---|---|
| P_PhysInvtryNotPostedMaterial | _NotPostedMaterial | union_all |
| P_MappedPhysInvtryItem | PiItem | left_outer |
| P_MappedPhysInvtryItem | PiItem | left_outer |
| P_MaterialDocumentExtract | StockSep | from |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA