P_EWM_PINVDOCCNTITEM02_2
P_EWM_PINVDOCCNTITEM02_2 is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_EWM_PINVDOCCNTITEM01_2) and exposes 54 fields with key fields PhysicalInventoryDocumentUUID, PhysicalInventoryItemNumber, LineIndexOfPInvItem, PInvQuantitySequence. It has 9 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_EWM_PINVDOCCNTITEM01_2 | _item | from |
Associations (9)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_EWM_PInvDocHeaderLog | _LogHeader | $projection.PhysicalInventoryDocumentUUID = _LogHeader.PhysicalInventoryDocumentUUID |
| [0..1] | I_EWM_SerialNumberHeader_2 | _SerialNumberHeader | _item.EWMWarehouse = _SerialNumberHeader.EWMWarehouse and _item.ProductUUID = _SerialNumberHeader.ProductUUID and _item.EntitledToDisposeParty = _SerialNumberHeader.EntitledToDisposeParty |
| [0..1] | I_EWM_SerialNumberProfile | _SerialNumberProfile | _item.SerialNumberProfile = _SerialNumberProfile.SerialNumberProfile |
| [0..1] | I_EWM_WhseSerialNmbrProfile_2 | _WhseSerialNumberProfile | _item.SerialNumberProfile = _WhseSerialNumberProfile.SerialNumberProfile and _item.EWMWarehouse = _WhseSerialNumberProfile.EWMWarehouse |
| [0..1] | I_BatchDistinct | _Batch | $projection.Product = _Batch.Material and $projection.BatchUUID = _Batch.BatchExtWhseMgmtInternalId |
| [0..1] | I_EWM_MaterialValuation | _MaterialValuation | $projection.Product = _MaterialValuation.Product and $projection.BatchUUID = _MaterialValuation.BatchUUID and $projection.EntitledToDisposeParty = _MaterialValuation.EntitledToDisposeParty |
| [0..1] | I_WBSElementBasicData | _WBSElementBasicData | $projection.StockDocumentCategory = 'PJS' and $projection.StockDocumentNumber = _WBSElementBasicData.WBSElementInternalID |
| [0..1] | I_EWM_WBSElementDecentralized | _WBSElementDecentralized | $projection.StockDocumentCategory = 'PJS' and $projection.StockDocumentNumber = _WBSElementDecentralized.StockDocumentNumber |
| [0..1] | I_EWM_WhseSystIsDecentralized | _WhseSystemIsDecentralized | _WhseSystemIsDecentralized.WarehouseSystemIsDecentralized = 'X' |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #M | view |
Fields (54)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PhysicalInventoryDocumentUUID | PhysicalInventoryDocumentUUID | ||
| KEY | PhysicalInventoryItemNumber | PhysicalInventoryItemNumber | ||
| KEY | LineIndexOfPInvItem | LineIndexOfPInvItem | ||
| KEY | PInvQuantitySequence | PInvQuantitySequence | ||
| EWMWarehouse | P_EWM_PINVDOCCNTITEM01_2 | EWMWarehouse | Warehouse No. | |
| PhysicalInventoryDocNumber | _LogHeader | PhysicalInventoryDocNumber | ||
| PhysicalInventoryDocYear | _LogHeader | PhysicalInventoryDocYear | ||
| PInvDocumentItemType | PInvDocumentItemType | |||
| PhysicalInventoryStatusText | PhysicalInventoryStatusText | |||
| PhysicalInventoryStockUUID | PhysicalInventoryStockUUID | |||
| PInvItemParentUUID | PInvItemParentUUID | |||
| EWMStorageBin | Storage Bin | |||
| EWMStorageType | EWMStorageType | Storage Type | ||
| ParentHandlingUnitNumber | ParentHandlingUnitNumber | |||
| ProductUUID | ProductUUID | UUID | ||
| Product | P_EWM_PINVDOCCNTITEM01_2 | Product | Product Sold | |
| BatchUUID | BatchUUID | Target Grp GUID | ||
| Batch | ||||
| EWMStockType | EWMStockType | Stock Type | ||
| EWMStockOwner | EWMStockOwner | Character Field with Length 10 | ||
| StockOwnerPartnerRole | StockOwnerPartnerRole | |||
| EWMStockUsage | EWMStockUsage | Usage | ||
| StockDocumentCategory | StockDocumentCategory | Special Reference Stock Type | ||
| StockDocumentNumber | StockDocumentNumber | |||
| StockItemNumber | StockItemNumber | |||
| DocumentReltdStockDocCat | DocumentReltdStockDocCat | |||
| EntitledToDisposeParty | EntitledToDisposeParty | Disposal Party | ||
| EntitledToDisposePartnerRole | EntitledToDisposePartnerRole | |||
| PackagingMaterial | PackagingMaterial | Packaging Materials | ||
| HandlingUnitType | HandlingUnitType | HUTyp | ||
| PInvItemParentType | PInvItemParentType | |||
| PhysicalInventoryItemLevel | PhysicalInventoryItemLevel | |||
| HandlingUnitNumber | HandlingUnitNumber | |||
| PhysicalInventoryItemType | PhysicalInventoryItemType | |||
| HndlgUnitItemCountedIsComplete | HndlgUnitItemCountedIsComplete | |||
| HndlgUnitItemCountedIsEmpty | HndlgUnitItemCountedIsEmpty | |||
| HndlgUnitItemCountedIsNotExist | HndlgUnitItemCountedIsNotExist | |||
| EWMStorageBinIsEmpty | EWMStorageBinIsEmpty | |||
| WhseQualityInspectionType | WhseQualityInspectionType | |||
| QualityInspectionDocUUID | QualityInspectionDocUUID | |||
| StockIdentificationNumber | StockIdentificationNumber | |||
| DocumentReltdStockDocUUID | DocumentReltdStockDocUUID | |||
| DocumentReltdStockDocItemUUID | DocumentReltdStockDocItemUUID | |||
| WhseTaskGoodsReceiptDateTime | WhseTaskGoodsReceiptDateTime | |||
| ShelfLifeExpirationDate | ShelfLifeExpirationDate | SLED/BBD | ||
| CountryOfOrigin | P_EWM_PINVDOCCNTITEM01_2 | CountryOfOrigin | Country/Region of Origin | |
| MatlBatchIsInRstrcdUseStock | MatlBatchIsInRstrcdUseStock | Batch restr. | ||
| PInvIsZeroCount | PInvIsZeroCount | |||
| RequestedQuantityUnit | RequestedQuantityUnit | Requested Quantity Unit | ||
| RequestedQuantityISOUnit | RequestedQuantityISOUnit | |||
| RequestedQuantitySAPUnit | RequestedQuantitySAPUnit | |||
| RequestedQuantity | RequestedQuantity | Requested Quantity | ||
| PInvItemChgUTCDateTime | PInvItemChgUTCDateTime | |||
| _ISOCode | _ISOCode |
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_PINVDOCCNTITEM02_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_PINVDOCCNTITEM02_2 AS
SELECT
PhysicalInventoryDocumentUUID,
PhysicalInventoryItemNumber,
LineIndexOfPInvItem,
PInvQuantitySequence,
_item.EWMWarehouse AS EWMWarehouse,
_LogHeader.PhysicalInventoryDocNumber AS PhysicalInventoryDocNumber,
_LogHeader.PhysicalInventoryDocYear AS PhysicalInventoryDocYear,
PInvDocumentItemType,
PhysicalInventoryStatusText,
PhysicalInventoryStockUUID,
PInvItemParentUUID,
cast( EWMStorageBin as /scwm/lgpla ) AS EWMStorageBin,
EWMStorageType,
ParentHandlingUnitNumber,
ProductUUID,
_item.Product AS Product,
BatchUUID,
case when _Batch.Batch is not null then _Batch.Batch else _MaterialValuation.InventoryValuationType end AS Batch,
EWMStockType,
EWMStockOwner,
StockOwnerPartnerRole,
EWMStockUsage,
StockDocumentCategory,
StockDocumentNumber,
StockItemNumber,
DocumentReltdStockDocCat,
EntitledToDisposeParty,
EntitledToDisposePartnerRole,
PackagingMaterial,
HandlingUnitType,
PInvItemParentType,
PhysicalInventoryItemLevel,
HandlingUnitNumber,
PhysicalInventoryItemType,
HndlgUnitItemCountedIsComplete,
HndlgUnitItemCountedIsEmpty,
HndlgUnitItemCountedIsNotExist,
EWMStorageBinIsEmpty,
WhseQualityInspectionType,
QualityInspectionDocUUID,
StockIdentificationNumber,
DocumentReltdStockDocUUID,
DocumentReltdStockDocItemUUID,
WhseTaskGoodsReceiptDateTime,
ShelfLifeExpirationDate,
_item.CountryOfOrigin AS CountryOfOrigin,
MatlBatchIsInRstrcdUseStock,
PInvIsZeroCount,
RequestedQuantityUnit,
RequestedQuantityISOUnit,
RequestedQuantitySAPUnit,
RequestedQuantity,
PInvItemChgUTCDateTime
FROM P_EWM_PINVDOCCNTITEM01_2 AS _item
LEFT OUTER JOIN I_EWM_PInvDocHeaderLog AS _LogHeader ON PhysicalInventoryDocumentUUID = _LogHeader.PhysicalInventoryDocumentUUID -- association [0..1]
LEFT OUTER JOIN I_EWM_SerialNumberHeader_2 AS _SerialNumberHeader ON _item.EWMWarehouse = _SerialNumberHeader.EWMWarehouse AND _item.ProductUUID = _SerialNumberHeader.ProductUUID AND _item.EntitledToDisposeParty = _SerialNumberHeader.EntitledToDisposeParty -- association [0..1]
LEFT OUTER JOIN I_EWM_SerialNumberProfile AS _SerialNumberProfile ON _item.SerialNumberProfile = _SerialNumberProfile.SerialNumberProfile -- association [0..1]
LEFT OUTER JOIN I_EWM_WhseSerialNmbrProfile_2 AS _WhseSerialNumberProfile ON _item.SerialNumberProfile = _WhseSerialNumberProfile.SerialNumberProfile AND _item.EWMWarehouse = _WhseSerialNumberProfile.EWMWarehouse -- association [0..1]
LEFT OUTER JOIN I_BatchDistinct AS _Batch ON Product = _Batch.Material AND BatchUUID = _Batch.BatchExtWhseMgmtInternalId -- association [0..1]
LEFT OUTER JOIN I_EWM_MaterialValuation AS _MaterialValuation ON Product = _MaterialValuation.Product AND BatchUUID = _MaterialValuation.BatchUUID AND EntitledToDisposeParty = _MaterialValuation.EntitledToDisposeParty -- association [0..1]
LEFT OUTER JOIN I_WBSElementBasicData AS _WBSElementBasicData ON StockDocumentCategory = 'PJS' AND StockDocumentNumber = _WBSElementBasicData.WBSElementInternalID -- association [0..1]
LEFT OUTER JOIN I_EWM_WBSElementDecentralized AS _WBSElementDecentralized ON StockDocumentCategory = 'PJS' AND StockDocumentNumber = _WBSElementDecentralized.StockDocumentNumber -- association [0..1]
LEFT OUTER JOIN I_EWM_WhseSystIsDecentralized AS _WhseSystemIsDecentralized ON _WhseSystemIsDecentralized.WarehouseSystemIsDecentralized = 'X' -- 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