P_PhysInvtryProposal_L1
Inventory proposal level 1
P_PhysInvtryProposal_L1 is a Composite CDS View that provides data about "Inventory proposal level 1" in SAP S/4HANA. It reads from 3 data sources (P_PhysInvtryNotPosted_L3, P_ProductPlantBasic, I_MaterialStock_2) and exposes 45 fields with key fields Material, Plant, StorageLocation, Batch, Supplier. It has 2 associations to related views. Part of development package ODATA_MM_IM_PI_MASS_CREATE.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| P_PhysInvtryNotPosted_L3 | _NotPostedMaterial | union_all |
| P_ProductPlantBasic | ProdPlant | inner |
| I_MaterialStock_2 | Stock | from |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_BatchPlant | _BatchPlant | _BatchPlant.Material = Stock.Material and _BatchPlant.Plant = Stock.Plant and _BatchPlant.Batch = Stock.Batch |
| [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 (9)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_EXCLUDED | view | |
| EndUserText.label | Inventory proposal level 1 | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (45)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Material | |||
| KEY | Plant | I_MaterialStock_2 | Plant | Valuation Area |
| KEY | StorageLocation | StorageLocation | ||
| KEY | Batch | Lot No. | ||
| KEY | Supplier | Supplier | ||
| KEY | SalesOrder | SD Document | ||
| KEY | SalesOrderItem | |||
| KEY | WBSElementInternalID | WBS Internal ID | ||
| KEY | Customer | Sold-to Party | ||
| KEY | StockOwner | Owner of stock | ||
| KEY | InventoryStockType | I_MaterialStock_2 | InventoryStockType | Stock Type |
| KEY | InventorySpecialStockType | I_MaterialStock_2 | InventorySpecialStockType | Special Stock Type |
| KEY | MaterialBaseUnit | I_MaterialStock_2 | MaterialBaseUnit | Unit of Measure |
| KEY | MaterialIsPostedToStock | |||
| CostEstimate | I_MaterialStock_2 | CostEstimate | Cost EstimateNo | |
| InventoryValuationType | Valuation Type | |||
| CycleCountType | ||||
| SerialIdentifierAssgmtProfile | P_ProductPlantBasic | SerialNumberProfile | SerialNoProfile | |
| MatlBatchIsInRstrcdUseStock | _BatchPlant | MatlBatchIsInRstrcdUseStock | Batch restr. | |
| CurrentDate | ||||
| MatlWrhsStkQtyInMatlBaseUnit | ||||
| PhysicalInventoryLastCountDate | ||||
| Material | ||||
| KEY | Plant | P_PhysInvtryNotPosted_L3 | Plant | Valuation Area |
| KEY | StorageLocation | P_PhysInvtryNotPosted_L3 | StorageLocation | StorageLocation |
| KEY | Batch | P_PhysInvtryNotPosted_L3 | Batch | Lot No. |
| KEY | Supplier | P_PhysInvtryNotPosted_L3 | Supplier | Supplier |
| KEY | SalesOrder | P_PhysInvtryNotPosted_L3 | SalesOrder | SD Document |
| KEY | SalesOrderItem | |||
| KEY | WBSElementInternalID | P_PhysInvtryNotPosted_L3 | WBSElementInternalID | WBS Internal ID |
| KEY | Customer | P_PhysInvtryNotPosted_L3 | Customer | Sold-to Party |
| KEY | StockOwner | P_PhysInvtryNotPosted_L3 | StockOwner | Owner of stock |
| KEY | InventoryStockType | P_PhysInvtryNotPosted_L3 | InventoryStockType | Stock Type |
| KEY | InventorySpecialStockType | P_PhysInvtryNotPosted_L3 | InventorySpecialStockType | Special Stock Type |
| KEY | MaterialBaseUnit | P_PhysInvtryNotPosted_L3 | BaseUnit | Unit of Measure |
| KEY | MaterialIsPostedToStock | |||
| ProdCostEstNumberendasCostEstimate | ||||
| InventoryValuationType | P_PhysInvtryNotPosted_L3 | InventoryValuationType | Valuation Type | |
| CycleCountType | ||||
| SerialIdentifierAssgmtProfile | P_PhysInvtryNotPosted_L3 | SerialNumberProfile | SerialNoProfile | |
| MatlBatchIsInRstrcdUseStock | P_PhysInvtryNotPosted_L3 | MatlBatchIsInRstrcdUseStock | Batch restr. | |
| CurrentDate | ||||
| MatlWrhsStkQtyInMatlBaseUnit | ||||
| PhysicalInventoryLastCountDate | ||||
| NumberOfPhysInventoryCounts |
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_PhysInvtryProposal_L1.
-- 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_PhysInvtryProposal_L1 AS
SELECT
cast(Stock.Material as matnr preserving type) AS Material,
Stock.Plant AS Plant,
cast(Stock.StorageLocation as lgort_d preserving type) AS StorageLocation,
cast(Stock.Batch as charg_d preserving type) AS Batch,
cast(Stock.Supplier as elifn preserving type) AS Supplier,
cast(Stock.SDDocument as kdauf preserving type) AS SalesOrder,
cast(Stock.SDDocumentItem as pi_sales_order_item preserving type) AS SalesOrderItem,
cast(Stock.WBSElementInternalID as mat_pspnr preserving type) AS WBSElementInternalID,
cast(Stock.Customer as ekunn preserving type) AS Customer,
cast(Stock.SpecialStockIdfgStockOwner as pi_owner_of_stock preserving type) AS StockOwner,
Stock.InventoryStockType AS InventoryStockType,
Stock.InventorySpecialStockType AS InventorySpecialStockType,
Stock.MaterialBaseUnit AS MaterialBaseUnit,
cast( 'X' as materialispostedtostock preserving type ) AS MaterialIsPostedToStock,
Stock.CostEstimate AS CostEstimate,
cast(_BatchPlant.InventoryValuationType as bwtar_d preserving type ) AS InventoryValuationType,
cast(ProdPlant.InventoryForCycleCountInd as mmim_cycle_count_type preserving type ) AS CycleCountType,
ProdPlant.SerialNumberProfile AS SerialIdentifierAssgmtProfile,
_BatchPlant.MatlBatchIsInRstrcdUseStock AS MatlBatchIsInRstrcdUseStock,
$session.system_date AS CurrentDate,
cast(sum(Stock.MatlWrhsStkQtyInMatlBaseUnit) as nsdm_stock_qty preserving type ) AS MatlWrhsStkQtyInMatlBaseUnit,
max(_KeyFigures.PhysicalInventoryLastCountDate) AS PhysicalInventoryLastCountDate,
case when ( _NotPostedMaterial.InventoryValuationType <> '' or _NotPostedMaterial.InventoryValuationType is not null ) then _DerivatingBatchValuation.ProdCostEstNumber when ( _NotPostedMaterial.ValuationCategory <> '' and _NotPostedMaterial.IsBatchManagementRequired = 'X' ) then _ValuatedProductValuation.ProdCostEstNumber else _NonValuatedProductValuation.ProdCostEstNumber end as CostEstimate AS ProdCostEstNumberendasCostEstimate,
max(_KeyFigures.NumberOfPhysInventoryCounts) AS NumberOfPhysInventoryCounts
FROM I_MaterialStock_2 AS Stock
INNER JOIN P_ProductPlantBasic AS ProdPlant ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_BatchPlant AS _BatchPlant ON _BatchPlant.Material = Stock.Material AND _BatchPlant.Plant = Stock.Plant AND _BatchPlant.Batch = Stock.Batch -- association [0..1]
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_PhysInvtryNotPosted_L3
;
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