P_PhysInvtryDocHeader2
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)
| Source | Alias | Join Type |
|---|---|---|
| ikpf | ikpf | from |
Associations (12)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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]
;
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