P_PhysInvtryDocHeader2

DDL: P_PHYSINVTRYDOCHEADER2 Type: view_entity BASIC

P_PhysInvtryDocHeader2 is a Basic CDS View in SAP S/4HANA. It reads from 1 data source (ikpf) and exposes 37 fields with key fields PhysicalInventoryDocument, FiscalYear. It has 12 associations to related views.

Data Sources (1)

SourceAliasJoin Type
ikpf ikpf from

Associations (12)

CardinalityTargetAliasCondition
[0..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[0..1] I_StorageLocation _StorageLocation $projection.Plant = _StorageLocation.Plant and $projection.StorageLocation = _StorageLocation.StorageLocation
[0..1] I_User _CreatedByUser $projection.CreatedByUserName = _CreatedByUser.UserID
[0..1] I_InventorySpecialStockType _InventorySpecialStockType $projection.InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType
[0..*] I_PhysInvtryDocItem _PhysInvtryDocItem $projection.PhysicalInventoryDocument = _PhysInvtryDocItem.PhysicalInventoryDocument and $projection.FiscalYear = _PhysInvtryDocItem.FiscalYear
[0..1] I_PhysInvtryGroupType _PhysInvtryGroupType $projection.PhysicalInventoryGroupType = _PhysInvtryGroupType.PhysicalInventoryGroupType
[0..1] I_PhysInvtryType _PhysInvtryType $projection.PhysicalInventoryType = _PhysInvtryType.PhysicalInventoryType
[0..1] I_StockTakingTransactionType _InventoryTransactionType $projection.InventoryTransactionType = _InventoryTransactionType.InventoryTransactionType
[0..1] I_PhysInvtryCountSts _PhysInvtryCountSts $projection.PhysicalInventoryCountStatus = _PhysInvtryCountSts.PhysicalInventoryCountStatus
[0..1] I_PhysInvtryDeletionSts _PhysInvtryDeletionSts $projection.PhysInvtryDeletionStatus = _PhysInvtryDeletionSts.PhysInvtryDeletionStatus
[0..1] I_PhysInvtryPostSts _PhysInvtryPostSts $projection.PhysInvtryAdjustmentPostingSts = _PhysInvtryPostSts.PhysInvtryAdjustmentPostingSts
[1..1] I_PhysInvtryDocFiscalYear _PhysInvtryDocFiscalYear $projection.FiscalYear = _PhysInvtryDocFiscalYear.FiscalYear

Annotations (6)

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

Fields (37)

KeyFieldSource TableSource FieldDescription
KEY PhysicalInventoryDocument
KEY FiscalYear ikpf gjahr Settlement Year
InventoryTransactionType
Plant ikpf werks Receiving Plant
StorageLocation ikpf lgort Sublocation
InventorySpecialStockType ikpf sobkz Special Stock
DocumentDate ikpf bldat Journal Entry Date
PhysInventoryPlannedCountDate ikpf gidat Plan.Count date
PhysicalInventoryLastCountDate ikpf zldat Count Date
PostingDate ikpf budat Posting Date
PostingFiscalPeriod
CreatedByUserName
PostingIsBlockedForPhysInvtry ikpf sperr Posting Block
PhysicalInventoryCountStatus ikpf zstat Count Status
PhysInvtryAdjustmentPostingSts ikpf dstat Print Status
PhysInventoryReferenceNumber
PhysInvtryDeletionStatus ikpf lstat Deletion Status
PhysInvtryDocHasQtySnapshot
PhysicalInventoryGroupType ikpf keord Grouping Type
PhysicalInventoryGroup ikpf ordng Grpg Crit.
PhysicalInventoryNumber
PhysicalInventoryDocumentDesc ikpf ibltxt Description
PhysicalInventoryType
LastChangeDateTime ikpf lastchange_datetime Time Stamp
SalesPriceValuationIsActive
_Plant _Plant
_StorageLocation _StorageLocation
_CreatedByUser _CreatedByUser
_InventorySpecialStockType _InventorySpecialStockType
_PhysInvtryDocItem _PhysInvtryDocItem
_PhysInvtryGroupType _PhysInvtryGroupType
_PhysInvtryType _PhysInvtryType
_InventoryTransactionType _InventoryTransactionType
_PhysInvtryCountSts _PhysInvtryCountSts
_PhysInvtryDeletionSts _PhysInvtryDeletionSts
_PhysInvtryPostSts _PhysInvtryPostSts
_PhysInvtryDocFiscalYear _PhysInvtryDocFiscalYear

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_PhysInvtryDocHeader2.
-- 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_PhysInvtryDocHeader2 AS
SELECT
  cast(ikpf.iblnr as pi_document preserving type) AS PhysicalInventoryDocument,
  ikpf.gjahr AS FiscalYear,
  cast(ikpf.vgart as pi_transaction_type preserving type) AS InventoryTransactionType,
  ikpf.werks AS Plant,
  ikpf.lgort AS StorageLocation,
  ikpf.sobkz AS InventorySpecialStockType,
  ikpf.bldat AS DocumentDate,
  ikpf.gidat AS PhysInventoryPlannedCountDate,
  ikpf.zldat AS PhysicalInventoryLastCountDate,
  ikpf.budat AS PostingDate,
  cast(ikpf.monat as pi_monat preserving type) AS PostingFiscalPeriod,
  cast(ikpf.usnam as pi_created_by_user preserving type) AS CreatedByUserName,
  ikpf.sperr AS PostingIsBlockedForPhysInvtry,
  ikpf.zstat AS PhysicalInventoryCountStatus,
  ikpf.dstat AS PhysInvtryAdjustmentPostingSts,
  cast(ikpf.xblni as pi_reference preserving type) AS PhysInventoryReferenceNumber,
  ikpf.lstat AS PhysInvtryDeletionStatus,
  cast(ikpf.xbufi as pi_book_inventory_freeze preserving type) AS PhysInvtryDocHasQtySnapshot,
  ikpf.keord AS PhysicalInventoryGroupType,
  ikpf.ordng AS PhysicalInventoryGroup,
  cast(ikpf.invnu as pi_number preserving type) AS PhysicalInventoryNumber,
  ikpf.ibltxt AS PhysicalInventoryDocumentDesc,
  cast(ikpf.invart as pi_type preserving type) AS PhysicalInventoryType,
  ikpf.lastchange_datetime AS LastChangeDateTime,
  cast(t001k.xvkbw as pi_is_sp_valuation_active preserving type) AS SalesPriceValuationIsActive
FROM ikpf
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant  -- association [0..1]
LEFT OUTER JOIN I_StorageLocation AS _StorageLocation ON Plant = _StorageLocation.Plant AND StorageLocation = _StorageLocation.StorageLocation  -- association [0..1]
LEFT OUTER JOIN I_User AS _CreatedByUser ON CreatedByUserName = _CreatedByUser.UserID  -- association [0..1]
LEFT OUTER JOIN I_InventorySpecialStockType AS _InventorySpecialStockType ON InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType  -- association [0..1]
LEFT OUTER JOIN I_PhysInvtryDocItem AS _PhysInvtryDocItem ON PhysicalInventoryDocument = _PhysInvtryDocItem.PhysicalInventoryDocument AND FiscalYear = _PhysInvtryDocItem.FiscalYear  -- association [0..*]
LEFT OUTER JOIN I_PhysInvtryGroupType AS _PhysInvtryGroupType ON PhysicalInventoryGroupType = _PhysInvtryGroupType.PhysicalInventoryGroupType  -- association [0..1]
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_PhysInvtryCountSts AS _PhysInvtryCountSts ON PhysicalInventoryCountStatus = _PhysInvtryCountSts.PhysicalInventoryCountStatus  -- association [0..1]
LEFT OUTER JOIN I_PhysInvtryDeletionSts AS _PhysInvtryDeletionSts ON PhysInvtryDeletionStatus = _PhysInvtryDeletionSts.PhysInvtryDeletionStatus  -- association [0..1]
LEFT OUTER JOIN I_PhysInvtryPostSts AS _PhysInvtryPostSts ON PhysInvtryAdjustmentPostingSts = _PhysInvtryPostSts.PhysInvtryAdjustmentPostingSts  -- association [0..1]
LEFT OUTER JOIN I_PhysInvtryDocFiscalYear AS _PhysInvtryDocFiscalYear ON FiscalYear = _PhysInvtryDocFiscalYear.FiscalYear  -- association [1..1]
;