P_GRIRPurchaseOrderHistory1
GR/IR Purchase Order History
P_GRIRPurchaseOrderHistory1 is a Consumption CDS View that provides data about "GR/IR Purchase Order History" in SAP S/4HANA. It reads from 2 data sources (I_PurchasingDocumentHistory, P_GRIRPurchaseOrderHistory2) and exposes 87 fields.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchasingDocumentHistory | I_PurchasingDocumentHistory | from |
| P_GRIRPurchaseOrderHistory2 | P_GRIRPurchaseOrderHistory2 | union_all |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.preserveKey | true | view | |
| AbapCatalog.sqlViewName | PFIGRIRPOHIS1 | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | GR/IR Purchase Order History | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.buffering.status | #NOT_ALLOWED | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (87)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| PurchasingDocument | I_PurchasingDocumentHistory | PurchasingDocument | Purchasing Document | |
| PurchasingDocumentItem | I_PurchasingDocumentHistory | PurchasingDocumentItem | Purchasing Doc. Item | |
| AccountAssignmentNumber | I_PurchasingDocumentHistory | AccountAssignmentNumber | Account Assgmt No. | |
| ConditionStep | ||||
| ConditionCount | ||||
| PurchasingHistoryDocumentType | I_PurchasingDocumentHistory | PurchasingHistoryDocumentType | ||
| PurchasingHistoryDocumentYear | ||||
| PurchasingHistoryDocument | I_PurchasingDocumentHistory | PurchasingHistoryDocument | Journal Entry | |
| PurchasingHistoryDocumentItem | I_PurchasingDocumentHistory | PurchasingHistoryDocumentItem | Posting View Item | |
| PurchasingHistoryCategory | I_PurchasingDocumentHistory | PurchasingHistoryCategory | ||
| GoodsMovementType | I_PurchasingDocumentHistory | GoodsMovementType | Movement Type | |
| PostingDate | I_PurchasingDocumentHistory | PostingDate | Posting Date for GR | |
| Currency | I_PurchasingDocumentHistory | Currency | Valuation Crcy | |
| CompanyCodeCurrency | I_PurchasingDocumentHistory | CompanyCodeCurrency | Local Currency | |
| ConditionType | Condition type | |||
| DebitCreditCode | I_PurchasingDocumentHistory | DebitCreditCode | Single-Character Flag | |
| IsCompletelyDelivered | I_PurchasingDocumentHistory | IsCompletelyDelivered | Is completely delivered | |
| ReferenceDocument | I_PurchasingDocumentHistory | ReferenceDocument | Reference Document | |
| ReferenceDocumentFiscalYear | ||||
| ReferenceDocumentItem | I_PurchasingDocumentHistory | ReferenceDocumentItem | Reference item | |
| Material | I_PurchasingDocumentHistory | Material | Vehicle Model | |
| DocumentDate | I_PurchasingDocumentHistory | DocumentDate | Journal Entry Date | |
| InventoryValuationType | I_PurchasingDocumentHistory | InventoryValuationType | Valuation Type | |
| DocumentReferenceID | I_PurchasingDocumentHistory | DocumentReferenceID | Reference | |
| DeliveryQuantityUnit | I_PurchasingDocumentHistory | DeliveryQuantityUnit | Unit of measure | |
| AccountingDocumentCreationDate | I_PurchasingDocumentHistory | AccountingDocumentCreationDate | Journal Entry Date | |
| PurgHistDocumentCreationTime | I_PurchasingDocumentHistory | PurgHistDocumentCreationTime | ||
| Quantity | I_PurchasingDocumentHistory | Quantity | Value | |
| PurOrdAmountInCompanyCodeCrcy | I_PurchasingDocumentHistory | PurOrdAmountInCompanyCodeCrcy | ||
| PurchaseOrderAmount | ||||
| QtyInPurchaseOrderPriceUnit | I_PurchasingDocumentHistory | QtyInPurchaseOrderPriceUnit | Qty in OPUn | |
| GRIRAcctClrgAmtInCoCodeCrcy | I_PurchasingDocumentHistory | GRIRAcctClrgAmtInCoCodeCrcy | ||
| GdsRcptBlkdStkQtyInOrdPrcUnit | I_PurchasingDocumentHistory | GdsRcptBlkdStkQtyInOrdPrcUnit | ||
| GdsRcptBlkdStkQtyInOrdQtyUnit | I_PurchasingDocumentHistory | GdsRcptBlkdStkQtyInOrdQtyUnit | ||
| InvoiceAmountInFrgnCurrency | I_PurchasingDocumentHistory | InvoiceAmountInFrgnCurrency | Invc. Amt Frgn Crcy | |
| QuantityInDeliveryQtyUnit | I_PurchasingDocumentHistory | QuantityInDeliveryQtyUnit | ||
| GRIRAcctClrgAmtInOrdTrnsacCrcy | I_PurchasingDocumentHistory | GRIRAcctClrgAmtInOrdTrnsacCrcy | ||
| QuantityInBaseUnit | I_PurchasingDocumentHistory | QuantityInBaseUnit | Quantity | |
| GRIRAcctClrgAmtInTransacCrcy | I_PurchasingDocumentHistory | GRIRAcctClrgAmtInTransacCrcy | ||
| InvoiceAmtInPurOrdTransacCrcy | I_PurchasingDocumentHistory | InvoiceAmtInPurOrdTransacCrcy | ||
| InvoiceAmtInCoCodeCrcy | ||||
| VltdGdsRcptBlkdQtyInOrdPrcUnit | I_PurchasingDocumentHistory | VltdGdsRcptBlkdQtyInOrdPrcUnit | ||
| VltdGdsRcptBlkdStkQtyInOrdUnit | I_PurchasingDocumentHistory | VltdGdsRcptBlkdStkQtyInOrdUnit | ||
| PurchasingDocument | Purchasing Document | |||
| PurchasingDocumentItem | P_GRIRPurchaseOrderHistory2 | PurchasingDocumentItem | Purchasing Doc. Item | |
| AccountAssignmentNumber | Account Assgmt No. | |||
| ConditionStep | P_GRIRPurchaseOrderHistory2 | ConditionStep | ||
| ConditionCount | P_GRIRPurchaseOrderHistory2 | ConditionCount | ||
| PurchasingHistoryDocumentType | P_GRIRPurchaseOrderHistory2 | PurchasingHistoryDocumentType | ||
| PurchasingHistoryDocumentYear | ||||
| PurchasingHistoryDocument | P_GRIRPurchaseOrderHistory2 | PurchasingHistoryDocument | Journal Entry | |
| PurchasingHistoryDocumentItem | P_GRIRPurchaseOrderHistory2 | PurchasingHistoryDocumentItem | Posting View Item | |
| PurchasingHistoryCategory | P_GRIRPurchaseOrderHistory2 | PurchasingHistoryCategory | ||
| GoodsMovementType | Movement Type | |||
| PostingDate | P_GRIRPurchaseOrderHistory2 | PostingDate | Posting Date for GR | |
| Currency | P_GRIRPurchaseOrderHistory2 | Currency | Valuation Crcy | |
| CompanyCodeCurrency | P_GRIRPurchaseOrderHistory2 | CompanyCodeCurrency | Local Currency | |
| ConditionType | P_GRIRPurchaseOrderHistory2 | ConditionType | Condition type | |
| DebitCreditCode | P_GRIRPurchaseOrderHistory2 | DebitCreditCode | Single-Character Flag | |
| IsCompletelyDelivered | Is completely delivered | |||
| ReferenceDocument | Reference Document | |||
| ReferenceDocumentFiscalYear | ||||
| ReferenceDocumentItem | Reference item | |||
| Material | Vehicle Model | |||
| DocumentDate | Journal Entry Date | |||
| InventoryValuationType | Valuation Type | |||
| DocumentReferenceID | P_GRIRPurchaseOrderHistory2 | DocumentReferenceID | Reference | |
| DeliveryQuantityUnit | Unit of measure | |||
| AccountingDocumentCreationDate | Journal Entry Date | |||
| PurgHistDocumentCreationTime | P_GRIRPurchaseOrderHistory2 | PurgHistDocumentCreationTime | ||
| Quantity | Value | |||
| PurOrdAmountInCompanyCodeCrcy | P_GRIRPurchaseOrderHistory2 | PurOrdAmountInCompanyCodeCrcy | ||
| PurchaseOrderAmount | ||||
| QtyInPurchaseOrderPriceUnit | P_GRIRPurchaseOrderHistory2 | QtyInPurchaseOrderPriceUnit | Qty in OPUn | |
| GRIRAcctClrgAmtInCoCodeCrcy | P_GRIRPurchaseOrderHistory2 | GRIRAcctClrgAmtInCoCodeCrcy | ||
| GdsRcptBlkdStkQtyInOrdPrcUnit | ||||
| GdsRcptBlkdStkQtyInOrdQtyUnit | ||||
| InvoiceAmountInFrgnCurrency | P_GRIRPurchaseOrderHistory2 | InvoiceAmountInFrgnCurrency | Invc. Amt Frgn Crcy | |
| QuantityInDeliveryQtyUnit | ||||
| GRIRAcctClrgAmtInOrdTrnsacCrcy | P_GRIRPurchaseOrderHistory2 | GRIRAcctClrgAmtInOrdTrnsacCrcy | ||
| QuantityInBaseUnit | Quantity | |||
| GRIRAcctClrgAmtInTransacCrcy | P_GRIRPurchaseOrderHistory2 | GRIRAcctClrgAmtInTransacCrcy | ||
| InvoiceAmtInPurOrdTransacCrcy | P_GRIRPurchaseOrderHistory2 | InvoiceAmtInPurOrdTransacCrcy | ||
| InvoiceAmtInCoCodeCrcy | P_GRIRPurchaseOrderHistory2 | InvoiceAmtInCoCodeCrcy | ||
| VltdGdsRcptBlkdQtyInOrdPrcUnit | ||||
| VltdGdsRcptBlkdStkQtyInOrdUnit | ||||
| ExchangeRateDifferenceAmount |
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_GRIRPurchaseOrderHistory1.
-- 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: PFIGRIRPOHIS1
CREATE VIEW P_GRIRPurchaseOrderHistory1 AS
SELECT
I_PurchasingDocumentHistory.PurchasingDocument AS PurchasingDocument,
I_PurchasingDocumentHistory.PurchasingDocumentItem AS PurchasingDocumentItem,
I_PurchasingDocumentHistory.AccountAssignmentNumber AS AccountAssignmentNumber,
cast( '000' as stunr preserving type) AS ConditionStep,
cast( '000' as dzaehk preserving type) AS ConditionCount,
I_PurchasingDocumentHistory.PurchasingHistoryDocumentType AS PurchasingHistoryDocumentType,
cast( I_PurchasingDocumentHistory.PurchasingHistoryDocumentYear as fis_grir_mjahr preserving type ) AS PurchasingHistoryDocumentYear,
I_PurchasingDocumentHistory.PurchasingHistoryDocument AS PurchasingHistoryDocument,
I_PurchasingDocumentHistory.PurchasingHistoryDocumentItem AS PurchasingHistoryDocumentItem,
I_PurchasingDocumentHistory.PurchasingHistoryCategory AS PurchasingHistoryCategory,
I_PurchasingDocumentHistory.GoodsMovementType AS GoodsMovementType,
I_PurchasingDocumentHistory.PostingDate AS PostingDate,
I_PurchasingDocumentHistory.Currency AS Currency,
I_PurchasingDocumentHistory.CompanyCodeCurrency AS CompanyCodeCurrency,
cast( '' as kschl) AS ConditionType,
I_PurchasingDocumentHistory.DebitCreditCode AS DebitCreditCode,
I_PurchasingDocumentHistory.IsCompletelyDelivered AS IsCompletelyDelivered,
I_PurchasingDocumentHistory.ReferenceDocument AS ReferenceDocument,
cast( I_PurchasingDocumentHistory.ReferenceDocumentFiscalYear as fis_grir_lfbja preserving type ) AS ReferenceDocumentFiscalYear,
I_PurchasingDocumentHistory.ReferenceDocumentItem AS ReferenceDocumentItem,
I_PurchasingDocumentHistory.Material AS Material,
I_PurchasingDocumentHistory.DocumentDate AS DocumentDate,
I_PurchasingDocumentHistory.InventoryValuationType AS InventoryValuationType,
I_PurchasingDocumentHistory.DocumentReferenceID AS DocumentReferenceID,
I_PurchasingDocumentHistory.DeliveryQuantityUnit AS DeliveryQuantityUnit,
I_PurchasingDocumentHistory.AccountingDocumentCreationDate AS AccountingDocumentCreationDate,
I_PurchasingDocumentHistory.PurgHistDocumentCreationTime AS PurgHistDocumentCreationTime,
I_PurchasingDocumentHistory.Quantity AS Quantity,
I_PurchasingDocumentHistory.PurOrdAmountInCompanyCodeCrcy AS PurOrdAmountInCompanyCodeCrcy,
cast(I_PurchasingDocumentHistory.PurchaseOrderAmount as wrbtr) AS PurchaseOrderAmount,
I_PurchasingDocumentHistory.QtyInPurchaseOrderPriceUnit AS QtyInPurchaseOrderPriceUnit,
I_PurchasingDocumentHistory.GRIRAcctClrgAmtInCoCodeCrcy AS GRIRAcctClrgAmtInCoCodeCrcy,
I_PurchasingDocumentHistory.GdsRcptBlkdStkQtyInOrdPrcUnit AS GdsRcptBlkdStkQtyInOrdPrcUnit,
I_PurchasingDocumentHistory.GdsRcptBlkdStkQtyInOrdQtyUnit AS GdsRcptBlkdStkQtyInOrdQtyUnit,
I_PurchasingDocumentHistory.InvoiceAmountInFrgnCurrency AS InvoiceAmountInFrgnCurrency,
I_PurchasingDocumentHistory.QuantityInDeliveryQtyUnit AS QuantityInDeliveryQtyUnit,
I_PurchasingDocumentHistory.GRIRAcctClrgAmtInOrdTrnsacCrcy AS GRIRAcctClrgAmtInOrdTrnsacCrcy,
I_PurchasingDocumentHistory.QuantityInBaseUnit AS QuantityInBaseUnit,
I_PurchasingDocumentHistory.GRIRAcctClrgAmtInTransacCrcy AS GRIRAcctClrgAmtInTransacCrcy,
I_PurchasingDocumentHistory.InvoiceAmtInPurOrdTransacCrcy AS InvoiceAmtInPurOrdTransacCrcy,
cast( 0 as reewr) AS InvoiceAmtInCoCodeCrcy,
I_PurchasingDocumentHistory.VltdGdsRcptBlkdQtyInOrdPrcUnit AS VltdGdsRcptBlkdQtyInOrdPrcUnit,
I_PurchasingDocumentHistory.VltdGdsRcptBlkdStkQtyInOrdUnit AS VltdGdsRcptBlkdStkQtyInOrdUnit,
cast( 0 as kudif) AS ExchangeRateDifferenceAmount
FROM I_PurchasingDocumentHistory
-- UNION ALL with additional select branch(es): P_GRIRPurchaseOrderHistory2
;
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