I_PurchaseOrderHistoryBasic
Purchase Order History
I_PurchaseOrderHistoryBasic is a Composite CDS View that provides data about "Purchase Order History" in SAP S/4HANA. It reads from 2 data sources (I_PurchasingDocumentHistory, R_PurchaseOrder) and exposes 59 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber, PurchasingHistoryDocumentType, PurchasingHistoryDocumentYear. It has 2 associations to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchasingDocumentHistory | history | from |
| R_PurchaseOrder | PurchaseOrder | inner |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | R_PurchaseOrder | _PurchaseOrder | history.PurchasingDocument = _PurchaseOrder.PurchaseOrder |
| [1..1] | R_PurchaseOrderItem | _PurchaseOrderItem | history.PurchasingDocument = _PurchaseOrderItem.PurchaseOrder and history.PurchasingDocumentItem = _PurchaseOrderItem.PurchaseOrderItem |
Annotations (12)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.preserveKey | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.sqlViewName | IMMPURORDHIST | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Purchase Order History | view | |
| VDM.viewType | #COMPOSITE | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_EXCLUDED | view | |
| VDM.lifecycle.contract.type | #SAP_INTERNAL_API | view |
Fields (59)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | PurchasingDocument | Purchasing Document | |
| KEY | PurchaseOrderItem | PurchasingDocumentItem | Purchasing Doc. Item | |
| KEY | AccountAssignmentNumber | AccountAssignmentNumber | Account Assgmt No. | |
| KEY | PurchasingHistoryDocumentType | PurchasingHistoryDocumentType | ||
| KEY | PurchasingHistoryDocumentYear | PurchasingHistoryDocumentYear | ||
| KEY | PurchasingHistoryDocument | PurchasingHistoryDocument | ||
| KEY | PurchasingHistoryDocumentItem | PurchasingHistoryDocumentItem | ||
| PurchasingHistoryCategory | PurchasingHistoryCategory | |||
| GoodsMovementType | GoodsMovementType | Movement Type | ||
| PostingDate | PostingDate | Posting Date for GR | ||
| Currency | Currency | Valuation Crcy | ||
| DebitCreditCode | DebitCreditCode | Single-Character Flag | ||
| IsCompletelyDelivered | IsCompletelyDelivered | Is completely delivered | ||
| ReferenceDocumentFiscalYear | ReferenceDocumentFiscalYear | Year Cur.Period | ||
| ReferenceDocument | ReferenceDocument | Reference Document | ||
| ReferenceDocumentItem | ReferenceDocumentItem | Reference item | ||
| Material | Material | Vehicle Model | ||
| Plant | Plant | Valuation Area | ||
| RvslOfGoodsReceiptIsAllowed | RvslOfGoodsReceiptIsAllowed | |||
| PricingDocument | I_PurchasingDocumentHistory | PricingDocument | Document Condition | |
| TaxCode | TaxCode | Tax Code | ||
| DocumentDate | DocumentDate | Journal Entry Date | ||
| CreatedByUser | I_PurchasingDocumentHistory | CreatedByUser | User Name | |
| InventoryValuationType | InventoryValuationType | Valuation Type | ||
| DocumentReferenceID | DocumentReferenceID | Reference | ||
| DeliveryQuantityUnit | DeliveryQuantityUnit | Unit of measure | ||
| ManufacturerMaterial | ManufacturerMaterial | MPN: Material | ||
| AccountingDocumentCreationDate | AccountingDocumentCreationDate | Journal Entry Date | ||
| PurgHistDocumentCreationTime | PurgHistDocumentCreationTime | |||
| Quantity | Quantity | Value | ||
| PurOrdAmountInCompanyCodeCrcy | PurOrdAmountInCompanyCodeCrcy | |||
| PurchaseOrderAmount | PurchaseOrderAmount | |||
| QtyInPurchaseOrderPriceUnit | QtyInPurchaseOrderPriceUnit | Qty in OPUn | ||
| GRIRAcctClrgAmtInCoCodeCrcy | GRIRAcctClrgAmtInCoCodeCrcy | |||
| GdsRcptBlkdStkQtyInOrdQtyUnit | GdsRcptBlkdStkQtyInOrdQtyUnit | |||
| GdsRcptBlkdStkQtyInOrdPrcUnit | GdsRcptBlkdStkQtyInOrdPrcUnit | |||
| InvoiceAmtInCoCodeCrcy | InvoiceAmtInCoCodeCrcy | |||
| ShipgInstrnSupplierCompliance | ShipgInstrnSupplierCompliance | |||
| InvoiceAmountInFrgnCurrency | InvoiceAmountInFrgnCurrency | Invc. Amt Frgn Crcy | ||
| QuantityInDeliveryQtyUnit | QuantityInDeliveryQtyUnit | |||
| GRIRAcctClrgAmtInTransacCrcy | GRIRAcctClrgAmtInTransacCrcy | |||
| QuantityInBaseUnit | QuantityInBaseUnit | Quantity | ||
| Batch | Batch | Lot No. | ||
| GRIRAcctClrgAmtInOrdTrnsacCrcy | GRIRAcctClrgAmtInOrdTrnsacCrcy | |||
| InvoiceAmtInPurOrdTransacCrcy | InvoiceAmtInPurOrdTransacCrcy | |||
| VltdGdsRcptBlkdStkQtyInOrdUnit | VltdGdsRcptBlkdStkQtyInOrdUnit | |||
| VltdGdsRcptBlkdQtyInOrdPrcUnit | VltdGdsRcptBlkdQtyInOrdPrcUnit | |||
| IsToBeAcceptedAtOrigin | IsToBeAcceptedAtOrigin | Origin Accept. | ||
| ExchangeRateDifferenceAmount | ExchangeRateDifferenceAmount | |||
| ExchangeRate | I_PurchasingDocumentHistory | ExchangeRate | Exchange rate | |
| DeliveryDocument | DeliveryDocument | Outbound Delivery | ||
| DeliveryDocumentItem | DeliveryDocumentItem | Outb. Delivery Item | ||
| OrderPriceUnit | OrderPriceUnit | Order Price Un. | ||
| PurchaseOrderQuantityUnit | OrderQuantityUnit | Sales Unit | ||
| BaseUnit | BaseUnit | Unit of Measure | ||
| DocumentCurrency | I_PurchasingDocumentHistory | DocumentCurrency | Document Currency | |
| CompanyCodeCurrency | I_PurchasingDocumentHistory | CompanyCodeCurrency | Local Currency | |
| _PurchaseOrder | _PurchaseOrder | |||
| _PurchaseOrderItem | _PurchaseOrderItem |
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 I_PurchaseOrderHistoryBasic.
-- 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: IMMPURORDHIST
CREATE VIEW I_PurchaseOrderHistoryBasic AS
SELECT
PurchasingDocument AS PurchaseOrder,
PurchasingDocumentItem AS PurchaseOrderItem,
AccountAssignmentNumber,
PurchasingHistoryDocumentType,
PurchasingHistoryDocumentYear,
PurchasingHistoryDocument,
PurchasingHistoryDocumentItem,
PurchasingHistoryCategory,
GoodsMovementType,
PostingDate,
Currency,
DebitCreditCode,
IsCompletelyDelivered,
ReferenceDocumentFiscalYear,
ReferenceDocument,
ReferenceDocumentItem,
Material,
Plant,
RvslOfGoodsReceiptIsAllowed,
history.PricingDocument AS PricingDocument,
TaxCode,
DocumentDate,
history.CreatedByUser AS CreatedByUser,
InventoryValuationType,
DocumentReferenceID,
DeliveryQuantityUnit,
ManufacturerMaterial,
AccountingDocumentCreationDate,
PurgHistDocumentCreationTime,
Quantity,
PurOrdAmountInCompanyCodeCrcy,
PurchaseOrderAmount,
QtyInPurchaseOrderPriceUnit,
GRIRAcctClrgAmtInCoCodeCrcy,
GdsRcptBlkdStkQtyInOrdQtyUnit,
GdsRcptBlkdStkQtyInOrdPrcUnit,
InvoiceAmtInCoCodeCrcy,
ShipgInstrnSupplierCompliance,
InvoiceAmountInFrgnCurrency,
QuantityInDeliveryQtyUnit,
GRIRAcctClrgAmtInTransacCrcy,
QuantityInBaseUnit,
Batch,
GRIRAcctClrgAmtInOrdTrnsacCrcy,
InvoiceAmtInPurOrdTransacCrcy,
VltdGdsRcptBlkdStkQtyInOrdUnit,
VltdGdsRcptBlkdQtyInOrdPrcUnit,
IsToBeAcceptedAtOrigin,
ExchangeRateDifferenceAmount,
history.ExchangeRate AS ExchangeRate,
DeliveryDocument,
DeliveryDocumentItem,
OrderPriceUnit,
OrderQuantityUnit AS PurchaseOrderQuantityUnit,
BaseUnit,
history.DocumentCurrency AS DocumentCurrency,
history.CompanyCodeCurrency AS CompanyCodeCurrency
FROM I_PurchasingDocumentHistory AS history
INNER JOIN R_PurchaseOrder AS PurchaseOrder ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN R_PurchaseOrder AS _PurchaseOrder ON history.PurchasingDocument = _PurchaseOrder.PurchaseOrder -- association [1..1]
LEFT OUTER JOIN R_PurchaseOrderItem AS _PurchaseOrderItem ON history.PurchasingDocument = _PurchaseOrderItem.PurchaseOrder AND history.PurchasingDocumentItem = _PurchaseOrderItem.PurchaseOrderItem -- 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