I_PhysInvtryCube
Physical Inventory - Cube
I_PhysInvtryCube (Composite)
Package: Explore, extend and adapt the SAP S/4HANA Cloud Private Edition with built-in and side-by-side extension capabilities.
Supply Chain
I_PhysInvtryCube is a Composite CDS View (Cube) that provides data about "Physical Inventory - Cube" in SAP S/4HANA. It reads from 1 data source (I_AugmentedPhysInvtryDocItem) and exposes 90 fields with key fields FiscalYear, PhysicalInventoryDocument, PhysicalInventoryDocumentItem. It has 6 associations to related views.
SAP API Hub
| State | C1 |
|---|---|
| Line of Business | Supply Chain |
| Application Component | MM-IM-VDM-PI |
| Capabilities | Data Provider for Analytical Queries, Data Source in SQL Select, Data Source for Defining CDS Entities |
| Package | Supply Chain for SAP S/4HANA Cloud Private Edition |
| Description | <p>This CDS view provides the prerequisites for answering the following business questions:</p> <ul> <li><p>How many counts were performed in a plant during the last year?</p></li> <li><p>Which materials have the biggest difference value?</p></li> <li><p>How big was the total difference amount in a single plant or storage location?</p></li> <li><p>Which materials were counted more than once during the last year?</p></li> </ul> |
Documentation
- Analytics with CDS Views — Build Analytics for S/4HANA Cloud Private Edition ABAP CDS views replicated to SAP Cloud Platform
- CDS Views on SAP Business Accelerator Hub — Explore SAP S/4HANA Cloud Private Edition Private Edition CDS Views on SAP Business Accelerator Hub
- Create CDS View as API — Create CDS views in SAP S/4HANA Cloud Private Edition and consume them as APIs
- Custom CDS Views — Access data using a Custom Core Data Service view (Custom CDS view)
- Key User Extensibility Tools — The Key User Extensibility Tools of S/4HANA
- SAP Extensibility Explorer for SAP S/4HANA Cloud Private Edition — Explore SAP S/4HANA Cloud Private Edition Extensibility options by leveraging the sample scenarios from SAP
- SAP S/4HANA Extensibility — SAP S/4HANA Extensibility Tutorial
- VDM View Types — The Virtual Data Model in SAP S/4HANA Cloud Private Edition
- View Browser — Search, browse and tag CDS Views
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_AugmentedPhysInvtryDocItem | I_AugmentedPhysInvtryDocItem | from |
Associations (6)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_PhysInvtryType | _PhysInvtryType | $projection.PhysicalInventoryType = _PhysInvtryType.PhysicalInventoryType |
| [0..1] | I_StockTakingTransactionType | _InventoryTransactionType | $projection.InventoryTransactionType = _InventoryTransactionType.InventoryTransactionType |
| [1..1] | I_Product | _Product | $projection.Material = _Product.Product |
| [1..1] | I_ProductPlant | _ProductPlantExt | $projection.Material = _ProductPlantExt.Product and $projection.Plant = _ProductPlantExt.Plant |
| [1..1] | I_Batch | _Batch | $projection.Material = _Batch.Material and $projection.Plant = _Batch.Plant and $projection.Batch = _Batch.Batch |
| [0..1] | E_PhysInvtryDocumentItem | _Extension | $projection.FiscalYear = _Extension.FiscalYear and $projection.PhysicalInventoryDocument = _Extension.PhysicalInventoryDocument and $projection.PhysicalInventoryDocumentItem = _Extension.PhysicalInventoryDocumentItem |
Annotations (16)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | IPHYINVTRYCUBE | view | |
| AbapCatalog.preserveKey | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| EndUserText.label | Physical Inventory - Cube | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_EXCLUDED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.modelingPattern | #ANALYTICAL_CUBE | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.lifecycle.contract.type | #PUBLIC_LOCAL_API | view | |
| Analytics.dataCategory | #CUBE | view | |
| Metadata.allowExtensions | true | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (90)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | FiscalYear | FiscalYear | G/L Fiscal Year | |
| KEY | PhysicalInventoryDocument | PhysicalInventoryDocument | Physical Inventory Document | |
| KEY | PhysicalInventoryDocumentItem | PhysicalInventoryDocumentItem | Physical Inventory Document Item | |
| Plant | Plant | Valuation Area | ||
| StorageLocation | StorageLocation | Storage Location | ||
| Material | Material | Material Number | ||
| RealProductBatch | RealProductBatch | Batch Number | ||
| Batch | Batch | Batch Number | ||
| ValuationType | ValuationType | Valuation Type | ||
| InventorySpecialStockType | InventorySpecialStockType | Special Stock Type | ||
| PhysicalInventoryStockType | PhysicalInventoryStockType | Stock Type (Physical Inventory) | ||
| SalesOrder | SalesOrder | Sales Order Number | ||
| SalesOrderItem | SalesOrderItem | Item Number in Sales Order | ||
| ScheduleLine | ScheduleLine | Delivery Schedule for Sales Order | ||
| Supplier | Supplier | Supplier's Account Number | ||
| Customer | Customer | Account number of customer | ||
| WBSElementInternalID | WBSElementInternalID | Work Breakdown Structure Element (WBS Element) | ||
| PhysicalInventoryItemIsCounted | PhysicalInventoryItemIsCounted | Item is Counted | ||
| PhysInvtryDifferenceIsPosted | PhysInvtryDifferenceIsPosted | Difference of Item is Posted | ||
| PhysInvtryItemIsRecounted | PhysInvtryItemIsRecounted | Item is Recounted | ||
| PhysInvtryItemIsDeleted | PhysInvtryItemIsDeleted | Item is Deleted | ||
| CycleCountType | CycleCountType | Cycle Count Type | ||
| PhysicalInventoryType | _PhysInvtryDocHeader | PhysicalInventoryType | Physical Inventory Type | |
| InventoryTransactionType | _PhysInvtryDocHeader | InventoryTransactionType | Inventory Transaction Type | |
| GoodsMovementType | GoodsMovementType | Movement Type for Adjustment | ||
| PostingIsBlockedForPhysInvtry | _PhysInvtryDocHeader | PostingIsBlockedForPhysInvtry | Posting Block Due to Physical Inventory | |
| PhysInvtryDocHasQtySnapshot | _PhysInvtryDocHeader | PhysInvtryDocHasQtySnapshot | Book Inventory Freeze | |
| PhysicalInventoryLastCountDate | PhysicalInventoryLastCountDate | Date of Last Count | ||
| PostingDate | PostingDate | Posting Date in the Document | ||
| ReasonForPhysInvtryDifference | ReasonForPhysInvtryDifference | Difference Reason | ||
| DocumentDate | _PhysInvtryDocHeader | DocumentDate | Document Date in Document | |
| LastChangeDate | LastChangeDate | Last Changed On | ||
| PhysInventoryPlannedCountDate | _PhysInvtryDocHeader | PhysInventoryPlannedCountDate | Planned Date of Inventory Count | |
| FiscalPeriod | _PhysInvtryDocHeader | FiscalPeriod | Posting Period | |
| PhysInvtryDiffIsDistributed | PhysInvtryDiffIsDistributed | Is Difference Distributed | ||
| Currency | Currency | Company Code Currency | ||
| PhysicalInventoryGroupType | _PhysInvtryDocHeader | PhysicalInventoryGroupType | Type of Grouping Criterion | |
| PhysicalInventoryGroup | _PhysInvtryDocHeader | PhysicalInventoryGroup | Grouping Criterion of Physical Inventory Document Item | |
| PhysicalInventoryNumber | _PhysInvtryDocHeader | PhysicalInventoryNumber | Physical Inventory Number | |
| PhysicalInventoryDocumentDesc | _PhysInvtryDocHeader | PhysicalInventoryDocumentDesc | Description of Physical Inventory Document | |
| PhysInventoryReferenceNumber | PhysInventoryReferenceNumber | Physical Inventory Reference | ||
| MaterialDocumentYear | MaterialDocumentYear | Material Document Year | ||
| MaterialDocument | MaterialDocument | Number of Material Document | ||
| MaterialDocumentItem | MaterialDocumentItem | Material Document Item | ||
| PhysInvtryRecountDocument | PhysInvtryRecountDocument | Number of Recount Document | ||
| IsValueOnlyMaterial | IsValueOnlyMaterial | Is Value-Only Material | ||
| IsHandledInAltvUnitOfMsr | IsHandledInAltvUnitOfMsr | Without Unit of Measure Proposal | ||
| ProductCategory | ProductCategory | Material Category | ||
| CrossPlantConfigurableMaterial | CrossPlantConfigurableMaterial | Cross-Plant Configurable Material | ||
| SalesPriceValuationIsActive | _PhysInvtryDocHeader | SalesPriceValuationIsActive | Is Sales Price Valuation Active | |
| BookQtyBfrCountInMatlBaseUnit | BookQtyBfrCountInMatlBaseUnit | Book Quantity Immediately Prior to Count | ||
| PhysicalInventoryItemIsZero | PhysicalInventoryItemIsZero | Is Zero Count | ||
| Quantity | Quantity | Counted Quantity | ||
| MaterialBaseUnit | MaterialBaseUnit | Base Unit of Measure | ||
| QuantityInUnitOfEntry | QuantityInUnitOfEntry | Counted Quantity in Entry Unit | ||
| DifferenceQuantityInBaseUnit | DifferenceQuantityInBaseUnit | Physical Inventory Item Difference Quantity in Base Unit | ||
| UnitOfEntry | UnitOfEntry | Unit of Entry | ||
| DiffSlsPrcAmtInCoCodeCrcy | DiffSlsPrcAmtInCoCodeCrcy | Value of Difference Based on Sales Price | ||
| EnteredSlsAmtInCoCodeCrcy | EnteredSlsAmtInCoCodeCrcy | Externally Entered Value Based on Sales Price | ||
| SlsPriceAmountInCoCodeCrcy | SlsPriceAmountInCoCodeCrcy | Sales Price Book Value | ||
| PhysInvtryCtAmtInCoCodeCrcy | PhysInvtryCtAmtInCoCodeCrcy | Counted Quantity Value | ||
| BookQtyAmountInCoCodeCrcy | BookQtyAmountInCoCodeCrcy | Book Value | ||
| DifferenceAmountInCoCodeCrcy | DifferenceAmountInCoCodeCrcy | Value of Difference | ||
| MaxAbsDiffAmountInCoCodeCrcy | MaxAbsDiffAmountInCoCodeCrcy | Maximum Value of Difference | ||
| MinAbsDiffAmountInCoCodeCrcy | MinAbsDiffAmountInCoCodeCrcy | Minimum Value of Difference | ||
| NumberOfPhysInvtryItems | NumberOfPhysInvtryItems | Number of Physical Inventory Items | ||
| _Plant | _Plant | |||
| _StorageLocation | _StorageLocation | |||
| _InventorySpecialStockType | _InventorySpecialStockType | |||
| _PhysInvtryType | _PhysInvtryType | |||
| _InventoryTransactionType | _InventoryTransactionType | |||
| _WBSElement | _WBSElement | |||
| _AdjmtPostingMovementType | _AdjmtPostingMovementType | |||
| _Supplier | _Supplier | |||
| _Customer | _Customer | |||
| _Material | _Material | |||
| _ProductPlant | _ProductPlant | |||
| _ProductStorageLocation | _ProductStorageLocation | |||
| _CrossPlantConfigurableMatl | _CrossPlantConfigurableMatl | |||
| _MaterialBaseUnit | _MaterialBaseUnit | |||
| _Currency | _Currency | |||
| _UnitOfEntry | _UnitOfEntry | |||
| _PhysicalInventoryStockType | _PhysicalInventoryStockType | |||
| _ProductCategory | _ProductCategory | |||
| _GoodsMovementType | _GoodsMovementType | |||
| _SupplierCompanyByPlant | _SupplierCompanyByPlant | |||
| _CustomerCompanyByPlant | _CustomerCompanyByPlant | |||
| _Product | _Product | |||
| _ProductPlantExt | _ProductPlantExt | |||
| _Batch | _Batch |
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 I_PhysInvtryCube.
-- 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 I_PhysInvtryCube AS
SELECT
FiscalYear,
PhysicalInventoryDocument,
PhysicalInventoryDocumentItem,
Plant,
StorageLocation,
Material,
RealProductBatch,
Batch,
ValuationType,
InventorySpecialStockType,
PhysicalInventoryStockType,
SalesOrder,
SalesOrderItem,
ScheduleLine,
Supplier,
Customer,
WBSElementInternalID,
PhysicalInventoryItemIsCounted,
PhysInvtryDifferenceIsPosted,
PhysInvtryItemIsRecounted,
PhysInvtryItemIsDeleted,
CycleCountType,
_PhysInvtryDocHeader.PhysicalInventoryType AS PhysicalInventoryType,
_PhysInvtryDocHeader.InventoryTransactionType AS InventoryTransactionType,
GoodsMovementType,
_PhysInvtryDocHeader.PostingIsBlockedForPhysInvtry AS PostingIsBlockedForPhysInvtry,
_PhysInvtryDocHeader.PhysInvtryDocHasQtySnapshot AS PhysInvtryDocHasQtySnapshot,
PhysicalInventoryLastCountDate,
PostingDate,
ReasonForPhysInvtryDifference,
_PhysInvtryDocHeader.DocumentDate AS DocumentDate,
LastChangeDate,
_PhysInvtryDocHeader.PhysInventoryPlannedCountDate AS PhysInventoryPlannedCountDate,
_PhysInvtryDocHeader.FiscalPeriod AS FiscalPeriod,
PhysInvtryDiffIsDistributed,
Currency,
_PhysInvtryDocHeader.PhysicalInventoryGroupType AS PhysicalInventoryGroupType,
_PhysInvtryDocHeader.PhysicalInventoryGroup AS PhysicalInventoryGroup,
_PhysInvtryDocHeader.PhysicalInventoryNumber AS PhysicalInventoryNumber,
_PhysInvtryDocHeader.PhysicalInventoryDocumentDesc AS PhysicalInventoryDocumentDesc,
PhysInventoryReferenceNumber,
MaterialDocumentYear,
MaterialDocument,
MaterialDocumentItem,
PhysInvtryRecountDocument,
IsValueOnlyMaterial,
IsHandledInAltvUnitOfMsr,
ProductCategory,
CrossPlantConfigurableMaterial,
_PhysInvtryDocHeader.SalesPriceValuationIsActive AS SalesPriceValuationIsActive,
BookQtyBfrCountInMatlBaseUnit,
PhysicalInventoryItemIsZero,
Quantity,
MaterialBaseUnit,
QuantityInUnitOfEntry,
DifferenceQuantityInBaseUnit,
UnitOfEntry,
DiffSlsPrcAmtInCoCodeCrcy,
EnteredSlsAmtInCoCodeCrcy,
SlsPriceAmountInCoCodeCrcy,
PhysInvtryCtAmtInCoCodeCrcy,
BookQtyAmountInCoCodeCrcy,
DifferenceAmountInCoCodeCrcy,
MaxAbsDiffAmountInCoCodeCrcy,
MinAbsDiffAmountInCoCodeCrcy,
NumberOfPhysInvtryItems
FROM I_AugmentedPhysInvtryDocItem
LEFT OUTER JOIN I_PhysInvtryType AS _PhysInvtryType ON PhysicalInventoryType = _PhysInvtryType.PhysicalInventoryType -- association [0..1]
LEFT OUTER JOIN I_StockTakingTransactionType AS _InventoryTransactionType ON InventoryTransactionType = _InventoryTransactionType.InventoryTransactionType -- association [0..1]
LEFT OUTER JOIN I_Product AS _Product ON Material = _Product.Product -- association [1..1]
LEFT OUTER JOIN I_ProductPlant AS _ProductPlantExt ON Material = _ProductPlantExt.Product AND Plant = _ProductPlantExt.Plant -- association [1..1]
LEFT OUTER JOIN I_Batch AS _Batch ON Material = _Batch.Material AND Plant = _Batch.Plant AND Batch = _Batch.Batch -- association [1..1]
LEFT OUTER JOIN E_PhysInvtryDocumentItem AS _Extension ON FiscalYear = _Extension.FiscalYear AND PhysicalInventoryDocument = _Extension.PhysicalInventoryDocument AND PhysicalInventoryDocumentItem = _Extension.PhysicalInventoryDocumentItem -- 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