P_PhysInvtryProposal
Proposals for new PI documents
P_PhysInvtryProposal is a Consumption CDS View that provides data about "Proposals for new PI documents" in SAP S/4HANA. It reads from 2 data sources (I_Plant, P_EnhPhysInvtryActvStkSepVal) and exposes 65 fields with key fields Plant, StorageLocation, Material, Batch, ValuationType. It has 21 associations to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_Plant | I_Plant | inner |
| P_EnhPhysInvtryActvStkSepVal | sep | from |
Associations (21)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_PhysInvtryIndBatchStorLoc | _BatchStorageLocation | $projection.Plant = _BatchStorageLocation.Plant and $projection.StorageLocation = _BatchStorageLocation.StorageLocation and $projection.Material = _BatchStorageLocation.Material and $projection.Batch = _BatchStorageLocation.Batch |
| [1..1] | I_ProductPlant | _ProductPlant | $projection.Material = _ProductPlant.Product and $projection.Plant = _ProductPlant.Plant |
| [0..1] | I_Plant | _Plant | $projection.Plant = _Plant.Plant |
| [0..1] | I_StorageLocation | _StorageLocation | $projection.Plant = _StorageLocation.Plant and $projection.StorageLocation = _StorageLocation.StorageLocation |
| [0..1] | I_Material | _Material | $projection.Material = _Material.Material |
| [0..1] | I_Product | _Product | $projection.Material = _Product.Product |
| [0..1] | I_Producttype | _ProductType | $projection.ProductType = _ProductType.ProductType |
| [0..1] | I_ProductGroup | _ProductGroup | $projection.ProductGroup = _ProductGroup.MaterialGroup |
| [0..1] | I_ProductStorageLocation | _ProductStorageLocation | $projection.Material = _ProductStorageLocation.Product and $projection.Plant = _ProductStorageLocation.Plant and $projection.StorageLocation = _ProductStorageLocation.StorageLocation |
| [0..1] | I_Supplier | _Supplier | $projection.Supplier = _Supplier.Supplier |
| [1..1] | I_SupplierCompanyByPlant | _SupplierCompanyByPlant | $projection.Supplier = _SupplierCompanyByPlant.Supplier and $projection.Plant = _SupplierCompanyByPlant.Plant |
| [0..1] | I_Customer | _Customer | $projection.Customer = _Customer.Customer |
| [1..1] | I_CustomerCompanyByPlant | _CustomerCompanyByPlant | $projection.Customer = _CustomerCompanyByPlant.Customer and $projection.Plant = _CustomerCompanyByPlant.Plant |
| [0..1] | I_InventoryStockType | _InventoryStockType | $projection.InventoryStockType = _InventoryStockType.InventoryStockType |
| [0..1] | I_InventorySpecialStockType | _InventorySpecialStockType | $projection.InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType |
| [0..1] | I_SalesOrder | _SalesOrder | $projection.SalesOrder = _SalesOrder.SalesOrder |
| [0..1] | I_UnitOfMeasure | _MaterialBaseUnit | $projection.MaterialBaseUnit = _MaterialBaseUnit.UnitOfMeasure |
| [0..1] | I_Currency | _Currency | $projection.CompanyCodeCurrency = _Currency.Currency |
| [0..1] | I_WBSElementByInternalKey | _WBSElement | $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID |
| [0..1] | I_MaterialValuationPrices | _Price | _Price.Material = $projection.Material and I_Plant.ValuationArea = _Price.ValuationArea and sep.InventoryValuationType = _Price.InventoryValuationType and sep.InventorySpecialStockTypeVal = _Price.InvtryValnSpecialStockType and sep.SalesOrderVal = _Price.SalesOrder and sep.SalesOrderItemVal = _Price.SalesOrderItem and sep.WBSElementInternalIDVal = _Price.WBSElementInternalID and sep.Supplier = '' and _Price.CurrencyRole = '10' and _Price.FiscalPeriodType = 'LF' and ( sep.InventorySpecialStockType = '' or sep.InventorySpecialStockType = 'V' or sep.InventorySpecialStockType = 'W' or sep.InventorySpecialStockType = 'O' or sep.InventorySpecialStockValnType <> '' ) |
| [0..1] | I_CycleCountingSettings | _CycleCounting | _CycleCounting.CycleCountType = $projection.CycleCountType and _CycleCounting.Plant = $projection.Plant |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | P_PIPROPOSAL | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.private | true | view | |
| VDM.viewType | #CONSUMPTION | view | |
| EndUserText.label | Proposals for new PI documents | view |
Fields (65)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Plant | P_EnhPhysInvtryActvStkSepVal | Plant | Valuation Area |
| KEY | StorageLocation | StorageLocation | StorageLocation | |
| KEY | Material | Material | Vehicle Model | |
| KEY | Batch | RealProductBatch | ||
| KEY | ValuationType | Valuation Type | ||
| KEY | Supplier | Supplier | Supplier | |
| KEY | SalesOrder | SalesOrder | SD Document | |
| KEY | SalesOrderItem | SalesOrderItem | Sales Order Item | |
| KEY | WBSElement | WBSElement | WBS Internal ID | |
| KEY | Customer | Customer | Sold-to Party | |
| KEY | StockOwner | StockOwner | Owner of stock | |
| KEY | InventoryStockType | InventoryStockType | Stock Type | |
| KEY | InventorySpecialStockType | InventorySpecialStockType | Special Stock Type | |
| KEY | MaterialIsPostedToStock | P_EnhPhysInvtryActvStkSepVal | MaterialIsPostedToStock | |
| KEY | MaterialBaseUnit | MaterialBaseUnit | Valuation Unit | |
| CycleCountType | CycleCountType | Cycle Count Type | ||
| NmbrOfPhysInvtryPerFiscalYear | NmbrOfPhysInvtryPerFiscalYear | |||
| PhysInvtryIntvlForCycCounting | PhysInvtryIntvlForCycCounting | |||
| PhysInvtryFloatTimeCycCounting | PhysInvtryFloatTimeCycCounting | |||
| WBSElementInternalID | P_EnhPhysInvtryActvStkSepVal | WBSElementInternalID | WBS Internal ID | |
| IsBatchManagementRequired | _ProductPlant | IsBatchManagementRequired | Batch Mgmt Rqt(Plnt) | |
| FactoryCalendar | _Plant | FactoryCalendar | Factory Calendar | |
| CreationDateMaterial | _ProductStorageLocation | CreationDate | Time Stamp | |
| CreationDateBatch | _BatchStorageLocation | CreationDate | Time Stamp | |
| MaterialName | ||||
| ProductType | ProductType | Product Type Group | ||
| ProductGroup | ProductGroup | Product Sold Group | ||
| SerialIdentifierAssgmtProfile | _Product | SerialIdentifierAssgmtProfile | Serial No. Prf. | |
| WarehouseStorageBin | _ProductStorageLocation | WarehouseStorageBin | Storage Bin | |
| IsMarkedForDeletionProduct | _Product | IsMarkedForDeletion | Purch.org. data | |
| IsMarkedForDeletion | _ProductPlant | IsMarkedForDeletion | Purch.org. data | |
| MatlWrhsStkQtyInMatlBaseUnit | Quantity | |||
| InventoryPrice | ||||
| MaterialPriceUnitQty | _Price | MaterialPriceUnitQty | Price unit | |
| CompanyCodeCurrency | P_EnhPhysInvtryActvStkSepVal | CompanyCodeCurrency | Local Currency | |
| NumberOfPhysInventoryCounts | P_EnhPhysInvtryActvStkSepVal | NumberOfPhysInventoryCounts | ||
| NumberOfPInvAdjustmentsPerYear | P_EnhPhysInvtryActvStkSepVal | NumberOfPInvAdjustmentsPerYear | ||
| PInvDiffQtyPerYearInBaseUnit | P_EnhPhysInvtryActvStkSepVal | PInvDiffQtyPerYearInBaseUnit | ||
| PhysicalInventoryLastCountDate | P_EnhPhysInvtryActvStkSepVal | PhysicalInventoryLastCountDate | Count Date | |
| NmbrOfDaysSinceLastPInvCount | P_EnhPhysInvtryActvStkSepVal | NmbrOfDaysSinceLastPInvCount | ||
| PhysicalInventoryItemIsCounted | P_EnhPhysInvtryActvStkSepVal | PhysicalInventoryItemIsCounted | Is Counted | |
| NrOfGdsRcptSinceLastPInvCount | P_EnhPhysInvtryActvStkSepVal | NrOfGdsRcptSinceLastPInvCount | ||
| GdsRcptQtySinceLastCtInBsUnt | P_EnhPhysInvtryActvStkSepVal | GdsRcptQtySinceLastCtInBsUnt | ||
| AvgStkQtySinceLastCountInBsUnt | ||||
| NrOfGoodsIssSinceLastPInvCount | P_EnhPhysInvtryActvStkSepVal | NrOfGoodsIssSinceLastPInvCount | ||
| GdsIssQtySinceLastCountInBsUnt | P_EnhPhysInvtryActvStkSepVal | GdsIssQtySinceLastCountInBsUnt | ||
| UnitOfMeasure | ||||
| _Plant | _Plant | |||
| _StorageLocation | _StorageLocation | |||
| _Supplier | _Supplier | |||
| _Material | _Material | |||
| _SupplierCompanyByPlant | _SupplierCompanyByPlant | |||
| _Customer | _Customer | |||
| _CustomerCompanyByPlant | _CustomerCompanyByPlant | |||
| _InventorySpecialStockType | _InventorySpecialStockType | |||
| _SalesOrder | _SalesOrder | |||
| _MaterialBaseUnit | _MaterialBaseUnit | |||
| _Currency | _Currency | |||
| _WBSElement | _WBSElement | |||
| _Product | _Product | |||
| _ProductType | _ProductType | |||
| _ProductGroup | _ProductGroup | |||
| _InventoryStockType | _InventoryStockType | |||
| _CycleCounting | _CycleCounting | |||
| _ProductPlant | _ProductPlant |
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.
-- 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: P_PIPROPOSAL
CREATE VIEW P_PhysInvtryProposal AS
SELECT
sep.Plant AS Plant,
StorageLocation,
Material,
RealProductBatch AS Batch,
cast(InventoryValuationType as bwtar_d) AS ValuationType,
Supplier,
SalesOrder,
SalesOrderItem,
WBSElement,
Customer,
StockOwner,
InventoryStockType,
InventorySpecialStockType,
sep.MaterialIsPostedToStock AS MaterialIsPostedToStock,
MaterialBaseUnit,
CycleCountType,
NmbrOfPhysInvtryPerFiscalYear,
PhysInvtryIntvlForCycCounting,
PhysInvtryFloatTimeCycCounting,
sep.WBSElementInternalID AS WBSElementInternalID,
_ProductPlant.IsBatchManagementRequired AS IsBatchManagementRequired,
_Plant.FactoryCalendar AS FactoryCalendar,
_ProductStorageLocation.CreationDate AS CreationDateMaterial,
_BatchStorageLocation.CreationDate AS CreationDateBatch,
_Material._Text[1: Language=$session.system_language].MaterialName AS MaterialName,
ProductType,
ProductGroup,
_Product.SerialIdentifierAssgmtProfile AS SerialIdentifierAssgmtProfile,
_ProductStorageLocation.WarehouseStorageBin AS WarehouseStorageBin,
_Product.IsMarkedForDeletion AS IsMarkedForDeletionProduct,
_ProductPlant.IsMarkedForDeletion AS IsMarkedForDeletion,
cast(MatlWrhsStkQtyInMatlBaseUnit as pi_current_quantity) AS MatlWrhsStkQtyInMatlBaseUnit,
cast(_Price.InventoryPrice as pi_inventory_price preserving type) AS InventoryPrice,
_Price.MaterialPriceUnitQty AS MaterialPriceUnitQty,
sep.CompanyCodeCurrency AS CompanyCodeCurrency,
sep.NumberOfPhysInventoryCounts AS NumberOfPhysInventoryCounts,
sep.NumberOfPInvAdjustmentsPerYear AS NumberOfPInvAdjustmentsPerYear,
sep.PInvDiffQtyPerYearInBaseUnit AS PInvDiffQtyPerYearInBaseUnit,
sep.PhysicalInventoryLastCountDate AS PhysicalInventoryLastCountDate,
sep.NmbrOfDaysSinceLastPInvCount AS NmbrOfDaysSinceLastPInvCount,
sep.PhysicalInventoryItemIsCounted AS PhysicalInventoryItemIsCounted,
sep.NrOfGdsRcptSinceLastPInvCount AS NrOfGdsRcptSinceLastPInvCount,
sep.GdsRcptQtySinceLastCtInBsUnt AS GdsRcptQtySinceLastCtInBsUnt,
cast(round(MatlWrhsStkQtyInMatlBaseUnit - sep.AvgStkQtySinceLastCountCorrect, 3) as pi_average_book_quantity) AS AvgStkQtySinceLastCountInBsUnt,
sep.NrOfGoodsIssSinceLastPInvCount AS NrOfGoodsIssSinceLastPInvCount,
sep.GdsIssQtySinceLastCountInBsUnt AS GdsIssQtySinceLastCountInBsUnt,
cast( cast( '10' as char3) as msehi) AS UnitOfMeasure
FROM P_EnhPhysInvtryActvStkSepVal AS sep
INNER JOIN I_Plant ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PhysInvtryIndBatchStorLoc AS _BatchStorageLocation ON Plant = _BatchStorageLocation.Plant AND StorageLocation = _BatchStorageLocation.StorageLocation AND Material = _BatchStorageLocation.Material AND Batch = _BatchStorageLocation.Batch -- association [0..1]
LEFT OUTER JOIN I_ProductPlant AS _ProductPlant ON Material = _ProductPlant.Product AND Plant = _ProductPlant.Plant -- association [1..1]
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant -- association [0..1]
LEFT OUTER JOIN I_StorageLocation AS _StorageLocation ON Plant = _StorageLocation.Plant AND StorageLocation = _StorageLocation.StorageLocation -- association [0..1]
LEFT OUTER JOIN I_Material AS _Material ON Material = _Material.Material -- association [0..1]
LEFT OUTER JOIN I_Product AS _Product ON Material = _Product.Product -- association [0..1]
LEFT OUTER JOIN I_Producttype AS _ProductType ON ProductType = _ProductType.ProductType -- association [0..1]
LEFT OUTER JOIN I_ProductGroup AS _ProductGroup ON ProductGroup = _ProductGroup.MaterialGroup -- association [0..1]
LEFT OUTER JOIN I_ProductStorageLocation AS _ProductStorageLocation ON Material = _ProductStorageLocation.Product AND Plant = _ProductStorageLocation.Plant AND StorageLocation = _ProductStorageLocation.StorageLocation -- association [0..1]
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier -- association [0..1]
LEFT OUTER JOIN I_SupplierCompanyByPlant AS _SupplierCompanyByPlant ON Supplier = _SupplierCompanyByPlant.Supplier AND Plant = _SupplierCompanyByPlant.Plant -- association [1..1]
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer -- association [0..1]
LEFT OUTER JOIN I_CustomerCompanyByPlant AS _CustomerCompanyByPlant ON Customer = _CustomerCompanyByPlant.Customer AND Plant = _CustomerCompanyByPlant.Plant -- association [1..1]
LEFT OUTER JOIN I_InventoryStockType AS _InventoryStockType ON InventoryStockType = _InventoryStockType.InventoryStockType -- association [0..1]
LEFT OUTER JOIN I_InventorySpecialStockType AS _InventorySpecialStockType ON InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType -- association [0..1]
LEFT OUTER JOIN I_SalesOrder AS _SalesOrder ON SalesOrder = _SalesOrder.SalesOrder -- association [0..1]
LEFT OUTER JOIN I_UnitOfMeasure AS _MaterialBaseUnit ON MaterialBaseUnit = _MaterialBaseUnit.UnitOfMeasure -- association [0..1]
LEFT OUTER JOIN I_Currency AS _Currency ON CompanyCodeCurrency = _Currency.Currency -- association [0..1]
LEFT OUTER JOIN I_WBSElementByInternalKey AS _WBSElement ON WBSElementInternalID = _WBSElement.WBSElementInternalID -- association [0..1]
LEFT OUTER JOIN I_MaterialValuationPrices AS _Price ON _Price.Material = Material AND I_Plant.ValuationArea = _Price.ValuationArea AND sep.InventoryValuationType = _Price.InventoryValuationType AND sep.InventorySpecialStockTypeVal = _Price.InvtryValnSpecialStockType AND sep.SalesOrderVal = _Price.SalesOrder AND sep.SalesOrderItemVal = _Price.SalesOrderItem AND sep.WBSElementInternalIDVal = _Price.WBSElementInternalID AND sep.Supplier = '' AND _Price.CurrencyRole = '10' AND _Price.FiscalPeriodType = 'LF' AND ( sep.InventorySpecialStockType = '' OR sep.InventorySpecialStockType = 'V' OR sep.InventorySpecialStockType = 'W' OR sep.InventorySpecialStockType = 'O' OR sep.InventorySpecialStockValnType <> '' ) -- association [0..1]
LEFT OUTER JOIN I_CycleCountingSettings AS _CycleCounting ON _CycleCounting.CycleCountType = CycleCountType AND _CycleCounting.Plant = Plant -- 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