P_PhysInvtryProposal_L2
Inventory proposal level 2
P_PhysInvtryProposal_L2 is a Composite CDS View that provides data about "Inventory proposal level 2" in SAP S/4HANA. It reads from 2 data sources (I_CompanyCode, P_PhysInvtryProposal_L1) and exposes 28 fields with key fields Material, Plant, StorageLocation, Batch, Supplier. It has 3 associations to related views. Part of development package ODATA_MM_IM_PI_MASS_CREATE.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_CompanyCode | _CompanyCode | inner |
| P_PhysInvtryProposal_L1 | L1 | from |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_WBSElementBasicData | _WBSElement | $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID |
| [0..1] | I_AdjmtPostingMovementType | _AdjmtPostingMovementTypeS | MatDoc.GoodsMovementType = _AdjmtPostingMovementTypeS.PhysInvtryIncreasingQtyMvtType and MatDoc.InventorySpecialStockType = _AdjmtPostingMovementTypeS.InventorySpecialStockType and _AdjmtPostingMovementTypeS.PhysicalInventoryStockType <> '' |
| [0..1] | I_AdjmtPostingMovementType | _AdjmtPostingMovementTypeD | MatDoc.GoodsMovementType = _AdjmtPostingMovementTypeD.PhysInvtryDecreasingQtyMvtType and MatDoc.InventorySpecialStockType = _AdjmtPostingMovementTypeD.InventorySpecialStockType and _AdjmtPostingMovementTypeD.PhysicalInventoryStockType <> '' |
Annotations (9)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_EXCLUDED | view | |
| EndUserText.label | Inventory proposal level 2 | 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 (28)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Material | P_PhysInvtryProposal_L1 | Material | Vehicle Model |
| KEY | Plant | P_PhysInvtryProposal_L1 | Plant | Valuation Area |
| KEY | StorageLocation | P_PhysInvtryProposal_L1 | StorageLocation | StorageLocation |
| KEY | Batch | P_PhysInvtryProposal_L1 | Batch | Lot No. |
| Batch | Lot No. | |||
| KEY | Supplier | P_PhysInvtryProposal_L1 | Supplier | Supplier |
| KEY | SalesOrder | P_PhysInvtryProposal_L1 | SalesOrder | SD Document |
| KEY | SalesOrderItem | |||
| KEY | WBSElement | |||
| KEY | Customer | P_PhysInvtryProposal_L1 | Customer | Sold-to Party |
| KEY | StockOwner | P_PhysInvtryProposal_L1 | StockOwner | Owner of stock |
| KEY | InventoryStockType | P_PhysInvtryProposal_L1 | InventoryStockType | Stock Type |
| KEY | InventorySpecialStockType | P_PhysInvtryProposal_L1 | InventorySpecialStockType | Special Stock Type |
| KEY | MaterialBaseUnit | P_PhysInvtryProposal_L1 | MaterialBaseUnit | Valuation Unit |
| KEY | MaterialIsPostedToStock | P_PhysInvtryProposal_L1 | MaterialIsPostedToStock | |
| CostEstimate | P_PhysInvtryProposal_L1 | CostEstimate | Cost EstimateNo | |
| InventoryValuationType | P_PhysInvtryProposal_L1 | InventoryValuationType | Valuation Type | |
| RealProductBatch | P_PhysInvtryProposal_L1 | RealProductBatch | ||
| RealProductBatch | ||||
| CycleCountType | P_PhysInvtryProposal_L1 | CycleCountType | Cycle Count Type | |
| SerialIdentifierAssgmtProfile | P_PhysInvtryProposal_L1 | SerialIdentifierAssgmtProfile | Serial No. Prf. | |
| MatlBatchIsInRstrcdUseStock | P_PhysInvtryProposal_L1 | MatlBatchIsInRstrcdUseStock | Batch restr. | |
| WBSElementInternalID | P_PhysInvtryProposal_L1 | WBSElementInternalID | WBS Internal ID | |
| CompanyCodeCurrency | I_CompanyCode | Currency | Valuation Crcy | |
| CurrentDate | P_PhysInvtryProposal_L1 | CurrentDate | ||
| MatlWrhsStkQtyInMatlBaseUnit | P_PhysInvtryProposal_L1 | MatlWrhsStkQtyInMatlBaseUnit | Quantity | |
| PhysicalInventoryLastCountDate | ||||
| fltpendasAvgStkQtySinceLastCountCorrect |
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_L2.
-- 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_L2 AS
SELECT
L1.Material AS Material,
L1.Plant AS Plant,
L1.StorageLocation AS StorageLocation,
L1.Batch AS Batch,
L1.Supplier AS Supplier,
L1.SalesOrder AS SalesOrder,
case when L1.SalesOrderItem is null then '000000' else L1.SalesOrderItem end AS SalesOrderItem,
case when L1.WBSElementInternalID = '00000000' then '' else _WBSElement.WBSElement end AS WBSElement,
L1.Customer AS Customer,
L1.StockOwner AS StockOwner,
L1.InventoryStockType AS InventoryStockType,
L1.InventorySpecialStockType AS InventorySpecialStockType,
L1.MaterialBaseUnit AS MaterialBaseUnit,
L1.MaterialIsPostedToStock AS MaterialIsPostedToStock,
L1.CostEstimate AS CostEstimate,
L1.InventoryValuationType AS InventoryValuationType,
L1.RealProductBatch AS RealProductBatch,
L1.CycleCountType AS CycleCountType,
L1.SerialIdentifierAssgmtProfile AS SerialIdentifierAssgmtProfile,
L1.MatlBatchIsInRstrcdUseStock AS MatlBatchIsInRstrcdUseStock,
L1.WBSElementInternalID AS WBSElementInternalID,
_CompanyCode.Currency AS CompanyCodeCurrency,
L1.CurrentDate AS CurrentDate,
L1.MatlWrhsStkQtyInMatlBaseUnit AS MatlWrhsStkQtyInMatlBaseUnit,
cast(L1.PhysicalInventoryLastCountDate as pi_last_count_date preserving type) AS PhysicalInventoryLastCountDate,
sum( case when MatDoc.PostingDate > L1.CurrentDate then cast( MatDoc.MatlStkChangeQtyInBaseUnit as abap.fltp) when MatDoc.PostingDate is null or MatDoc.PostingDate < L1.PhysicalInventoryLastCountDate then cast( 0 as abap.fltp) when MatDoc.PostingDate = L1.PhysicalInventoryLastCountDate then cast(MatDoc.MatlStkChangeQtyInBaseUnit as abap.fltp) *0.5 / (1.0 + cast(dats_days_between( L1.PhysicalInventoryLastCountDate, L1.CurrentDate ) as abap.fltp)) else cast(MatDoc.MatlStkChangeQtyInBaseUnit as abap.fltp) * (0.5 + cast(dats_days_between( L1.PhysicalInventoryLastCountDate, MatDoc.PostingDate ) as abap.fltp)) / (1.0 + cast(dats_days_between( L1.PhysicalInventoryLastCountDate, L1.CurrentDate ) as abap.fltp)) end ) as AvgStkQtySinceLastCountCorrect AS fltpendasAvgStkQtySinceLastCountCorrect
FROM P_PhysInvtryProposal_L1 AS L1
INNER JOIN I_CompanyCode AS _CompanyCode ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_WBSElementBasicData AS _WBSElement ON WBSElementInternalID = _WBSElement.WBSElementInternalID -- association [0..1]
LEFT OUTER JOIN I_AdjmtPostingMovementType AS _AdjmtPostingMovementTypeS ON MatDoc.GoodsMovementType = _AdjmtPostingMovementTypeS.PhysInvtryIncreasingQtyMvtType AND MatDoc.InventorySpecialStockType = _AdjmtPostingMovementTypeS.InventorySpecialStockType AND _AdjmtPostingMovementTypeS.PhysicalInventoryStockType <> '' -- association [0..1]
LEFT OUTER JOIN I_AdjmtPostingMovementType AS _AdjmtPostingMovementTypeD ON MatDoc.GoodsMovementType = _AdjmtPostingMovementTypeD.PhysInvtryDecreasingQtyMvtType AND MatDoc.InventorySpecialStockType = _AdjmtPostingMovementTypeD.InventorySpecialStockType AND _AdjmtPostingMovementTypeD.PhysicalInventoryStockType <> '' -- association [0..1]
;
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