P_EWM_PhysInvtryDocItem_2
P_EWM_PhysInvtryDocItem_2 is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_EWM_PhysicalInventoryDocItem) and exposes 36 fields with key fields PhysicalInventoryDocumentUUID, PhysicalInventoryItemNumber. It has 7 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_EWM_PhysicalInventoryDocItem | _DocItem | from |
Associations (7)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_EWM_PInvDocHeaderLog | _LogHeader | $projection.PhysicalInventoryDocumentUUID = _LogHeader.PhysicalInventoryDocumentUUID |
| [0..1] | I_EWM_PInvDocItemLog | _WhseOrder | $projection.PhysicalInventoryDocumentUUID = _WhseOrder.PhysicalInventoryDocumentUUID and $projection.PhysicalInventoryItemNumber = _WhseOrder.PhysicalInventoryItemNumber and _WhseOrder.PhysicalInventoryProcessType = 'SCWM' and _WhseOrder.PhysicalInventoryRefDocType = 'SCWM_WHO' |
| [0..1] | I_EWM_PInvDocItemLog | _PrecedingDocument | $projection.PhysicalInventoryDocumentUUID = _PrecedingDocument.PhysicalInventoryDocumentUUID and $projection.PhysicalInventoryItemNumber = _PrecedingDocument.PhysicalInventoryItemNumber and _PrecedingDocument.PhysicalInventoryLogType = 'RO' and _PrecedingDocument.PhysicalInventoryProcessType = 'SCWM' and _PrecedingDocument.PhysicalInventoryRefDocType = 'SCWM_PIDO' |
| [0..1] | I_EWM_PInvDocItemLog | _Reference | $projection.PhysicalInventoryDocumentUUID = _Reference.PhysicalInventoryDocumentUUID and $projection.PhysicalInventoryItemNumber = _Reference.PhysicalInventoryItemNumber and _Reference.PhysicalInventoryProcessType = 'SCWM' and _Reference.PhysicalInventoryRefDocType = 'SCWM_REFUI' |
| [0..1] | I_BusinessPartner | _StockOwner | $projection.ewmstockowner = _StockOwner.BusinessPartner |
| [0..1] | I_BusinessPartner | _Entitled | $projection.entitledtodisposeparty = _Entitled.BusinessPartner |
| [0..1] | P_EWM_PInvDocItemLastChange | _LastChange | $projection.PhysicalInventoryDocumentUUID = _LastChange.PhysicalInventoryDocumentUUID and $projection.PhysicalInventoryItemNumber = _LastChange.PhysicalInventoryItemNumber |
Annotations (3)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (36)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PhysicalInventoryDocumentUUID | I_EWM_PhysicalInventoryDocItem | PhysicalInventoryDocumentUUID | GUID |
| KEY | PhysicalInventoryItemNumber | I_EWM_PhysicalInventoryDocItem | PhysicalInventoryItemNumber | Sort No. |
| PhysicalInventoryDocNumber | _LogHeader | PhysicalInventoryDocNumber | ||
| PhysicalInventoryDocYear | _LogHeader | PhysicalInventoryDocYear | ||
| PInvDocumentItemType | I_EWM_PhysicalInventoryDocItem | PInvDocumentItemType | Type | |
| PhysicalInventoryDocumentType | I_EWM_PhysicalInventoryDocItem | PhysicalInventoryDocumentType | VAT Document Type | |
| EWMPhysInvtryDifferenceReason | I_EWM_PhysicalInventoryDocItem | EWMPhysInvtryDifferenceReason | Sp.Tax Code Reason | |
| EWMPhysicalInventoryPriority | I_EWM_PhysicalInventoryDocItem | EWMPhysicalInventoryPriority | Workflow priority | |
| PhysicalInventoryStatusText | I_EWM_PhysicalInventoryDocItem | PhysicalInventoryStatusText | VL Doc Status | |
| PhysInventoryCrtnUTCDateTime | I_EWM_PhysicalInventoryDocItem | PhysicalInventoryCreateDate | Time Stamp | |
| PhysicalInventoryCountUserName | I_EWM_PhysicalInventoryDocItem | PhysicalInventoryCountUserName | User Name | |
| WarehouseOrder | ||||
| PInvDocumentItemIsPrinted | ||||
| PhysicalInventoryIsBlock | ||||
| PInvBookQuantityIsFreeze | ||||
| EWMWarehouse | I_EWM_PhysicalInventoryDocItem | EWMWarehouse | Warehouse No. | |
| EWMStorageType | ||||
| EWMStorageBin | ||||
| PhysicalInventoryArea | _PIAreaMapping | PhysicalInventoryArea | ||
| ActivityArea | _PIAreaMapping | ActivityArea | ||
| ProductUUID | ||||
| BatchUUID | ||||
| EWMStockType | ||||
| EWMStockUsage | ||||
| EWMStockOwner | ||||
| EntitledToDisposeParty | ||||
| StockDocumentCategory | ||||
| StockDocumentNumber | ||||
| StockItemNumber | ||||
| PhysicalInventoryRefDocYear | ||||
| EWMRefPhysicalInventoryDoc | ||||
| PhysicalInventoryRefDocItem | ||||
| PInvFreeDefinedRefText | _Reference | PhysicalInventoryRefDocNumber | ||
| PInvItemChgUTCDateTime | ||||
| _StockOwner | _StockOwner | |||
| _Entitled | _Entitled |
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_EWM_PhysInvtryDocItem_2.
-- 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_EWM_PhysInvtryDocItem_2 AS
SELECT
_DocItem.PhysicalInventoryDocumentUUID AS PhysicalInventoryDocumentUUID,
_DocItem.PhysicalInventoryItemNumber AS PhysicalInventoryItemNumber,
_LogHeader.PhysicalInventoryDocNumber AS PhysicalInventoryDocNumber,
_LogHeader.PhysicalInventoryDocYear AS PhysicalInventoryDocYear,
_DocItem.PInvDocumentItemType AS PInvDocumentItemType,
_DocItem.PhysicalInventoryDocumentType AS PhysicalInventoryDocumentType,
_DocItem.EWMPhysInvtryDifferenceReason AS EWMPhysInvtryDifferenceReason,
_DocItem.EWMPhysicalInventoryPriority AS EWMPhysicalInventoryPriority,
_DocItem.PhysicalInventoryStatusText AS PhysicalInventoryStatusText,
_DocItem.PhysicalInventoryCreateDate AS PhysInventoryCrtnUTCDateTime,
_DocItem.PhysicalInventoryCountUserName AS PhysicalInventoryCountUserName,
cast(substring(_WhseOrder.PhysicalInventoryRefDocNumber ,5, 10) as /scwm/de_who_noconv) AS WarehouseOrder,
cast(_DocItem.PInvDocumentItemIsPrinted as boole_d) AS PInvDocumentItemIsPrinted,
cast(_DocItem.PhysicalInventoryIsBlock as boole_d) AS PhysicalInventoryIsBlock,
cast(_DocItem.PInvBookQuantityIsFreeze as boole_d) AS PInvBookQuantityIsFreeze,
_DocItem.EWMWarehouse AS EWMWarehouse,
_DocItem._ParentItem.EWMStorageType AS EWMStorageType,
_DocItem._ParentItem.EWMStorageBin AS EWMStorageBin,
_PIAreaMapping.PhysicalInventoryArea AS PhysicalInventoryArea,
_PIAreaMapping.ActivityArea AS ActivityArea,
cast(_DocItem._KeyItem.ProductUUID as /scwm/de_matid_noconv) AS ProductUUID,
_DocItem._KeyItem.BatchUUID AS BatchUUID,
_DocItem._KeyItem.EWMStockType AS EWMStockType,
_DocItem._KeyItem.EWMStockUsage AS EWMStockUsage,
_DocItem._KeyItem.EWMStockOwner AS EWMStockOwner,
_DocItem._KeyItem.EntitledToDisposeParty AS EntitledToDisposeParty,
_DocItem._KeyItem.StockDocumentCategory AS StockDocumentCategory,
_DocItem._KeyItem.StockDocumentNumber AS StockDocumentNumber,
_DocItem._KeyItem.StockItemNumber AS StockItemNumber,
cast(substring(_PrecedingDocument.PhysicalInventoryRefDocNumber ,5, 4) as /lime/pi_doc_year) AS PhysicalInventoryRefDocYear,
cast(substring(_PrecedingDocument.PhysicalInventoryRefDocNumber ,9, 20) as /lime/pi_doc_number) AS EWMRefPhysicalInventoryDoc,
cast(substring(_PrecedingDocument.PhysicalInventoryRefDocNumber ,29, 6) as /lime/line_item_id) AS PhysicalInventoryRefDocItem,
_Reference.PhysicalInventoryRefDocNumber AS PInvFreeDefinedRefText,
cast(_LastChange.PInvLogItemTimeStamp as /lime/timestamp_int) AS PInvItemChgUTCDateTime
FROM I_EWM_PhysicalInventoryDocItem AS _DocItem
LEFT OUTER JOIN I_EWM_PInvDocHeaderLog AS _LogHeader ON PhysicalInventoryDocumentUUID = _LogHeader.PhysicalInventoryDocumentUUID -- association [0..1]
LEFT OUTER JOIN I_EWM_PInvDocItemLog AS _WhseOrder ON PhysicalInventoryDocumentUUID = _WhseOrder.PhysicalInventoryDocumentUUID AND PhysicalInventoryItemNumber = _WhseOrder.PhysicalInventoryItemNumber AND _WhseOrder.PhysicalInventoryProcessType = 'SCWM' AND _WhseOrder.PhysicalInventoryRefDocType = 'SCWM_WHO' -- association [0..1]
LEFT OUTER JOIN I_EWM_PInvDocItemLog AS _PrecedingDocument ON PhysicalInventoryDocumentUUID = _PrecedingDocument.PhysicalInventoryDocumentUUID AND PhysicalInventoryItemNumber = _PrecedingDocument.PhysicalInventoryItemNumber AND _PrecedingDocument.PhysicalInventoryLogType = 'RO' AND _PrecedingDocument.PhysicalInventoryProcessType = 'SCWM' AND _PrecedingDocument.PhysicalInventoryRefDocType = 'SCWM_PIDO' -- association [0..1]
LEFT OUTER JOIN I_EWM_PInvDocItemLog AS _Reference ON PhysicalInventoryDocumentUUID = _Reference.PhysicalInventoryDocumentUUID AND PhysicalInventoryItemNumber = _Reference.PhysicalInventoryItemNumber AND _Reference.PhysicalInventoryProcessType = 'SCWM' AND _Reference.PhysicalInventoryRefDocType = 'SCWM_REFUI' -- association [0..1]
LEFT OUTER JOIN I_BusinessPartner AS _StockOwner ON ewmstockowner = _StockOwner.BusinessPartner -- association [0..1]
LEFT OUTER JOIN I_BusinessPartner AS _Entitled ON entitledtodisposeparty = _Entitled.BusinessPartner -- association [0..1]
LEFT OUTER JOIN P_EWM_PInvDocItemLastChange AS _LastChange ON PhysicalInventoryDocumentUUID = _LastChange.PhysicalInventoryDocumentUUID AND PhysicalInventoryItemNumber = _LastChange.PhysicalInventoryItemNumber -- 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