P_PhysInvtryDocItem

DDL: P_PHYSINVTRYDOCITEM Type: view_entity COMPOSITE Package: MM_IM_VDM_PI

PI Document Calculate Difference Values

P_PhysInvtryDocItem is a Composite CDS View that provides data about "PI Document Calculate Difference Values" in SAP S/4HANA. It reads from 1 data source (I_PhysInvtryDocItem) and exposes 85 fields with key fields PhysicalInventoryDocument, FiscalYear, PhysicalInventoryDocumentItem. It has 8 associations to related views. Part of development package MM_IM_VDM_PI.

Data Sources (1)

SourceAliasJoin Type
I_PhysInvtryDocItem I_PhysInvtryDocItem from

Associations (8)

CardinalityTargetAliasCondition
[0..1] I_AdjmtPostingMovementType _AdjmtPostingMvtType $projection.PhysicalInventoryStockType = _AdjmtPostingMvtType.PhysicalInventoryStockType and $projection.InventorySpecialStockType = _AdjmtPostingMvtType.InventorySpecialStockType
[0..1] I_MaterialDocumentRecord _MaterialDocumentRecord $projection.MaterialDocument = _MaterialDocumentRecord.MaterialDocument and $projection.MaterialDocumentYear = _MaterialDocumentRecord.MaterialDocumentYear and $projection.MaterialDocumentItem = _MaterialDocumentRecord.MaterialDocumentItem and $projection.MaterialDocument <> ''
[0..*] I_PhysInvtryDocSrlNmbr _PhysInvtryDocSrlNmbr $projection.PhysicalInventoryDocument = _PhysInvtryDocSrlNmbr.PhysicalInventoryDocument and $projection.FiscalYear = _PhysInvtryDocSrlNmbr.FiscalYear and $projection.PhysicalInventoryDocumentItem = _PhysInvtryDocSrlNmbr.PhysicalInventoryDocumentItem
[0..1] I_GoodsMovementType _GoodsMovementType $projection.GoodsMovementType = _GoodsMovementType.GoodsMovementType
[0..1] I_PhysInvtryReasonCode _PhysInvtryReasonCode $projection.GoodsMovementType = _PhysInvtryReasonCode.GoodsMovementType and $projection.ReasonForPhysInvtryDifference = _PhysInvtryReasonCode.ReasonForPhysInvtryDifference
[0..1] I_CycleCountingSettings _CycleCounting _CycleCounting.CycleCountType = $projection.CycleCountType and _CycleCounting .Plant = $projection.Plant
[0..1] I_SitnInstceIndicator _SitnInstceIndicator _SitnInstceIndicator.SitnInstceAnchorObjectKey = $projection.PhysInvtrySitnID and _SitnInstceIndicator.SitnDefAnchorObject = 'PhysInvtrySitnID'
[1..*] R_PhysInvtryOutpRequestItem _PhysInvtryOutpRequestItem $projection.PhysicalInventoryDocument = _PhysInvtryOutpRequestItem.PhysicalInventoryDocument and $projection.FiscalYear = _PhysInvtryOutpRequestItem.FiscalYear and $projection.PhysicalInventoryDocumentItem = _PhysInvtryOutpRequestItem.PhysicalInventoryDocumentItem

Annotations (6)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (85)

KeyFieldSource TableSource FieldDescription
KEY PhysicalInventoryDocument PhysicalInventoryDocument Physical Inventory Document
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY PhysicalInventoryDocumentItem PhysicalInventoryDocumentItem Physical Inventory Document Item
PhysInvtrySitnID
Material Material Vehicle Model
Plant Plant Valuation Area
StorageLocation StorageLocation StorageLocation
RealProductBatch RealProductBatch
Batch Batch Lot No.
ValuationType ValuationType Valuation Type
InventorySpecialStockType InventorySpecialStockType Special Stock Type
PhysicalInventoryStockType PhysicalInventoryStockType Stock Type
GoodsMovementType _MaterialDocumentRecord GoodsMovementType Movement Type
SalesOrder SalesOrder SD Document
SalesOrderItem Sales Order Item
ScheduleLine ScheduleLine Schedule Line
Supplier Supplier Supplier
Customer Sold-to Party
StockOwner StockOwner Owner of stock
LastChangeUser LastChangeUser User Name
LastChangeDate LastChangeDate Time Stamp
CountedByUser CountedByUser Counted By
PhysicalInventoryLastCountDate PhysicalInventoryLastCountDate Count Date
AdjustmentPostingMadeByUser AdjustmentPostingMadeByUser Adjustment Posting Made By
PostingDate PostingDate Posting Date for GR
PhysInventoryReferenceNumber PhysInventoryReferenceNumber Physical Inventory Reference
PhysicalInventoryItemIsCounted PhysicalInventoryItemIsCounted Is Counted
PhysInvtryDifferenceIsPosted PhysInvtryDifferenceIsPosted Is Difference Posted
PhysInvtryItemIsRecounted PhysInvtryItemIsRecounted Is Recounted
PhysInvtryItemIsDeleted PhysInvtryItemIsDeleted Is Deleted
IsHandledInAltvUnitOfMsr IsHandledInAltvUnitOfMsr Without Unit of Measure Proposal
PhysicalInventoryItemIsZero PhysicalInventoryItemIsZero Zero Counted
BookQtyBfrCountInMatlBaseUnit BookQtyBfrCountInMatlBaseUnit Book Quantity
Quantity Quantity Value
MaterialBaseUnit MaterialBaseUnit Valuation Unit
QuantityInUnitOfEntry QuantityInUnitOfEntry Quantity in UnE
UnitOfEntry UnitOfEntry Unit of Entry
DifferenceAmountInCoCodeCrcy DifferenceAmountInCoCodeCrcy Difference Val.
Currency Currency Valuation Crcy
EnteredSlsAmtInCoCodeCrcy EnteredSlsAmtInCoCodeCrcy Sales Price Counted Value
SlsPriceAmountInCoCodeCrcy SlsPriceAmountInCoCodeCrcy Sales Price Book Value
PhysInvtryCtAmtInCoCodeCrcy PhysInvtryCtAmtInCoCodeCrcy Counted Quantity Value
BookQtyAmountInCoCodeCrcy BookQtyAmountInCoCodeCrcy Book Value
DifferenceQuantityInBaseUnit
DiffSlsPrcAmtInCoCodeCrcy
DiffCountedBookAmtInCoCodeCry
MaterialDocument MaterialDocument Material Doc.
MaterialDocumentYear MaterialDocumentYear Material Document Year
MaterialDocumentItem MaterialDocumentItem Material Document Item
PhysInvtryRecountDocument PhysInvtryRecountDocument Recount Doc.
CycleCountType CycleCountType Cycle Count Type
NmbrOfPhysInvtryPerFiscalYear _CycleCounting NmbrOfPhysInvtryPerFiscalYear
PhysInvtryIntvlForCycCounting _CycleCounting PhysInvtryIntvlForCycCounting
PhysInvtryFloatTimeCycCounting _CycleCounting PhysInvtryFloatTimeCycCounting
WBSElementInternalID WBSElementInternalID WBS Internal ID
IsValueOnlyMaterial IsValueOnlyMaterial Is Value-Only Material
ProductCategory ProductCategory Prod Category
ReasonForPhysInvtryDifference ReasonForPhysInvtryDifference Difference Reason
CrossPlantConfigurableMaterial CrossPlantConfigurableMaterial Cross-Plant Configurable Material
PhysInvtryDiffIsDistributed PhysInvtryDiffIsDistributed Difference Distributed
_SitnInstceIndicator _SitnInstceIndicator
_Material _Material
_ProductPlant _ProductPlant
_ProductStorageLocation _ProductStorageLocation
_CrossPlantConfigurableMatl _CrossPlantConfigurableMatl
_LastChangeUser _LastChangeUser
_CountedByUser _CountedByUser
_AdjustmentPostingMadeByUser _AdjustmentPostingMadeByUser
_MaterialBaseUnit _MaterialBaseUnit
_Currency _Currency
_Supplier _Supplier
_Customer _Customer
_Plant _Plant
_StorageLocation _StorageLocation
_UnitOfEntry _UnitOfEntry
_PhysInvtryStatusT _PhysInvtryStatusT
_PhysInvtryDocHeader _PhysInvtryDocHeader
_PhysInvtryDocSrlNmbr _PhysInvtryDocSrlNmbr
_PhysicalInventoryStockType _PhysicalInventoryStockType
_InventorySpecialStockType _InventorySpecialStockType
_PhysInvtryReasonCode _PhysInvtryReasonCode
_GoodsMovementType _GoodsMovementType
_ProductCategory _ProductCategory
_SupplierCompanyByPlant _SupplierCompanyByPlant
_CustomerCompanyByPlant _CustomerCompanyByPlant

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_PhysInvtryDocItem.
-- 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_PhysInvtryDocItem AS
SELECT
  PhysicalInventoryDocument,
  FiscalYear,
  PhysicalInventoryDocumentItem,
  cast( concat( FiscalYear, concat( PhysicalInventoryDocument, PhysicalInventoryDocumentItem ) ) as mmim_pi_situation_id) AS PhysInvtrySitnID,
  Material,
  Plant,
  StorageLocation,
  RealProductBatch,
  Batch,
  ValuationType,
  InventorySpecialStockType,
  PhysicalInventoryStockType,
  _MaterialDocumentRecord.GoodsMovementType AS GoodsMovementType,
  SalesOrder,
  cast(SalesOrderItem as pi_kdpos preserving type) AS SalesOrderItem,
  ScheduleLine,
  Supplier,
  cast(Customer as kunnr preserving type) AS Customer,
  StockOwner,
  LastChangeUser,
  LastChangeDate,
  CountedByUser,
  PhysicalInventoryLastCountDate,
  AdjustmentPostingMadeByUser,
  PostingDate,
  PhysInventoryReferenceNumber,
  PhysicalInventoryItemIsCounted,
  PhysInvtryDifferenceIsPosted,
  PhysInvtryItemIsRecounted,
  PhysInvtryItemIsDeleted,
  IsHandledInAltvUnitOfMsr,
  PhysicalInventoryItemIsZero,
  BookQtyBfrCountInMatlBaseUnit,
  Quantity,
  MaterialBaseUnit,
  QuantityInUnitOfEntry,
  UnitOfEntry,
  DifferenceAmountInCoCodeCrcy,
  Currency,
  EnteredSlsAmtInCoCodeCrcy,
  SlsPriceAmountInCoCodeCrcy,
  PhysInvtryCtAmtInCoCodeCrcy,
  BookQtyAmountInCoCodeCrcy,
  cast((Quantity - BookQtyBfrCountInMatlBaseUnit) as pi_item_diff_qty_i_base_unit) AS DifferenceQuantityInBaseUnit,
  cast((EnteredSlsAmtInCoCodeCrcy - SlsPriceAmountInCoCodeCrcy) as pi_item_diff_sls_prc_co_cry) AS DiffSlsPrcAmtInCoCodeCrcy,
  cast((PhysInvtryCtAmtInCoCodeCrcy - BookQtyAmountInCoCodeCrcy) as mmim_pi_dif_count_book_value ) AS DiffCountedBookAmtInCoCodeCry,
  MaterialDocument,
  MaterialDocumentYear,
  MaterialDocumentItem,
  PhysInvtryRecountDocument,
  CycleCountType,
  _CycleCounting.NmbrOfPhysInvtryPerFiscalYear AS NmbrOfPhysInvtryPerFiscalYear,
  _CycleCounting.PhysInvtryIntvlForCycCounting AS PhysInvtryIntvlForCycCounting,
  _CycleCounting.PhysInvtryFloatTimeCycCounting AS PhysInvtryFloatTimeCycCounting,
  WBSElementInternalID,
  IsValueOnlyMaterial,
  ProductCategory,
  ReasonForPhysInvtryDifference,
  CrossPlantConfigurableMaterial,
  PhysInvtryDiffIsDistributed
FROM I_PhysInvtryDocItem
LEFT OUTER JOIN I_AdjmtPostingMovementType AS _AdjmtPostingMvtType ON PhysicalInventoryStockType = _AdjmtPostingMvtType.PhysicalInventoryStockType AND InventorySpecialStockType = _AdjmtPostingMvtType.InventorySpecialStockType  -- association [0..1]
LEFT OUTER JOIN I_MaterialDocumentRecord AS _MaterialDocumentRecord ON MaterialDocument = _MaterialDocumentRecord.MaterialDocument AND MaterialDocumentYear = _MaterialDocumentRecord.MaterialDocumentYear AND MaterialDocumentItem = _MaterialDocumentRecord.MaterialDocumentItem AND MaterialDocument <> ''  -- association [0..1]
LEFT OUTER JOIN I_PhysInvtryDocSrlNmbr AS _PhysInvtryDocSrlNmbr ON PhysicalInventoryDocument = _PhysInvtryDocSrlNmbr.PhysicalInventoryDocument AND FiscalYear = _PhysInvtryDocSrlNmbr.FiscalYear AND PhysicalInventoryDocumentItem = _PhysInvtryDocSrlNmbr.PhysicalInventoryDocumentItem  -- association [0..*]
LEFT OUTER JOIN I_GoodsMovementType AS _GoodsMovementType ON GoodsMovementType = _GoodsMovementType.GoodsMovementType  -- association [0..1]
LEFT OUTER JOIN I_PhysInvtryReasonCode AS _PhysInvtryReasonCode ON GoodsMovementType = _PhysInvtryReasonCode.GoodsMovementType AND ReasonForPhysInvtryDifference = _PhysInvtryReasonCode.ReasonForPhysInvtryDifference  -- association [0..1]
LEFT OUTER JOIN I_CycleCountingSettings AS _CycleCounting ON _CycleCounting.CycleCountType = CycleCountType AND _CycleCounting .Plant = Plant  -- association [0..1]
LEFT OUTER JOIN I_SitnInstceIndicator AS _SitnInstceIndicator ON _SitnInstceIndicator.SitnInstceAnchorObjectKey = PhysInvtrySitnID AND _SitnInstceIndicator.SitnDefAnchorObject = 'PhysInvtrySitnID'  -- association [0..1]
LEFT OUTER JOIN R_PhysInvtryOutpRequestItem AS _PhysInvtryOutpRequestItem ON PhysicalInventoryDocument = _PhysInvtryOutpRequestItem.PhysicalInventoryDocument AND FiscalYear = _PhysInvtryOutpRequestItem.FiscalYear AND PhysicalInventoryDocumentItem = _PhysInvtryOutpRequestItem.PhysicalInventoryDocumentItem  -- association [1..*]
;