Deprecated
This CDS view is deprecated in S/4HANA. Use P_EWM_PhysInvtryDocItem_2 instead. View all deprecated CDS views →

P_EWM_PhysicalInventoryDocItem

DDL: P_EWM_PHYSICALINVENTORYDOCITEM SQL: PEWMPIDOCIT Type: view COMPOSITE

P_EWM_PhysicalInventoryDocItem is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_EWM_PhysicalInventoryDocItem, I_EWM_PhysicalInventoryArea, I_EWM_ActyAreaMappingPInvArea) and exposes 36 fields with key fields PhysicalInventoryDocumentUUID, PhysicalInventoryItemNumber. It has 7 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_EWM_PhysicalInventoryDocItem _DocItem from
I_EWM_PhysicalInventoryArea _PIArea left_outer
I_EWM_ActyAreaMappingPInvArea _PIAreaMapping left_outer

Associations (7)

CardinalityTargetAliasCondition
[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_EWM_BusinessPartner _StockOwner $projection.stockowner = _StockOwner.BusinessPartner
[0..1] I_EWM_BusinessPartner _Entitled $projection.entitledtodisposeparty = _Entitled.BusinessPartner
[0..1] P_EWM_PInvDocItemLastChange _LastChange $projection.PhysicalInventoryDocumentUUID = _LastChange.PhysicalInventoryDocumentUUID and $projection.PhysicalInventoryItemNumber = _LastChange.PhysicalInventoryItemNumber

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PEWMPIDOCIT view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.type #INHERITED view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.preserveKey true view
VDM.private true view
VDM.viewType #COMPOSITE view
VDM.lifecycle.status #DEPRECATED view
VDM.lifecycle.successor P_EWM_PhysInvtryDocItem_2 view

Fields (36)

KeyFieldSource TableSource FieldDescription
KEY PhysicalInventoryDocumentUUID I_EWM_PhysicalInventoryDocItem PhysicalInventoryDocumentUUID GUID
KEY PhysicalInventoryItemNumber I_EWM_PhysicalInventoryDocItem PhysicalInventoryItemNumber Sort No.
PhysicalInventoryDocNumber _LogHeader PhysicalInventoryDocNumber
PhysicalInventoryDocYear _LogHeader PhysicalInventoryDocYear
PInvDocumentItemType PInvDocumentItemType Type
PhysicalInventoryDocumentType I_EWM_PhysicalInventoryDocItem PhysicalInventoryDocumentType VAT Document Type
ReasonForPhysInvtryDifference I_EWM_PhysicalInventoryDocItem ReasonForPhysInvtryDifference Difference Reason
PriorityCode I_EWM_PhysicalInventoryDocItem PriorityCode 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 Print
PhysicalInventoryIsBlock BlockingInd.
PInvBookQuantityIsFreeze Freeze Book Inv.
Warehouse I_EWM_PhysicalInventoryDocItem Warehouse Warehouse No.
StorageType _ParentItem StorageType Storage Type
StorageBin _ParentItem StorageBin Storage Bin
PhysicalInventoryArea I_EWM_ActyAreaMappingPInvArea PhysicalInventoryArea Phys. Inv. Area
ActivityArea I_EWM_ActyAreaMappingPInvArea ActivityArea Activity Area
ProductUUID
BatchUUID _KeyItem BatchUUID Target Grp GUID
StockType _KeyItem StockType Stock Type
StockUsage _KeyItem StockUsage
StockOwner _KeyItem StockOwner Owner of stock
EntitledToDisposeParty _KeyItem EntitledToDisposeParty Disposal Party
StockDocumentCategory _KeyItem StockDocumentCategory Special Reference Stock Type
StockDocumentNumber _KeyItem StockDocumentNumber
StockItemNumber _KeyItem StockItemNumber
PhysicalInventoryRefDocYear
PhysicalInventoryRefDocNumber
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_PhysicalInventoryDocItem.
-- 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: PEWMPIDOCIT

CREATE VIEW P_EWM_PhysicalInventoryDocItem AS
SELECT
  _DocItem.PhysicalInventoryDocumentUUID AS PhysicalInventoryDocumentUUID,
  _DocItem.PhysicalInventoryItemNumber AS PhysicalInventoryItemNumber,
  _LogHeader.PhysicalInventoryDocNumber AS PhysicalInventoryDocNumber,
  _LogHeader.PhysicalInventoryDocYear AS PhysicalInventoryDocYear,
  PInvDocumentItemType,
  _DocItem.PhysicalInventoryDocumentType AS PhysicalInventoryDocumentType,
  _DocItem.ReasonForPhysInvtryDifference AS ReasonForPhysInvtryDifference,
  _DocItem.PriorityCode AS PriorityCode,
  _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(PInvDocumentItemIsPrinted as boole_d) AS PInvDocumentItemIsPrinted,
  cast(PhysicalInventoryIsBlock as boole_d) AS PhysicalInventoryIsBlock,
  cast(PInvBookQuantityIsFreeze as boole_d) AS PInvBookQuantityIsFreeze,
  _DocItem.Warehouse AS Warehouse,
  _ParentItem.StorageType AS StorageType,
  _ParentItem.StorageBin AS StorageBin,
  _PIAreaMapping.PhysicalInventoryArea AS PhysicalInventoryArea,
  _PIAreaMapping.ActivityArea AS ActivityArea,
  cast(_KeyItem.ProductUUID as /scwm/de_matid_noconv) AS ProductUUID,
  _KeyItem.BatchUUID AS BatchUUID,
  _KeyItem.StockType AS StockType,
  _KeyItem.StockUsage AS StockUsage,
  _KeyItem.StockOwner AS StockOwner,
  _KeyItem.EntitledToDisposeParty AS EntitledToDisposeParty,
  _KeyItem.StockDocumentCategory AS StockDocumentCategory,
  _KeyItem.StockDocumentNumber AS StockDocumentNumber,
  _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 PhysicalInventoryRefDocNumber,
  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_PhysicalInventoryArea AS _PIArea ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_EWM_ActyAreaMappingPInvArea AS _PIAreaMapping ON /* join condition not captured in parsed metadata */
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_EWM_BusinessPartner AS _StockOwner ON stockowner = _StockOwner.BusinessPartner  -- association [0..1]
LEFT OUTER JOIN I_EWM_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]
;