I_PurchaseOrderHistoryAPI01

DDL: I_PURCHASEORDERHISTORYAPI01 SQL: IMMPURORDHISAP01 Type: view COMPOSITE

Purchase Order History

I_PurchaseOrderHistoryAPI01 (Composite)

Package: Explore, extend and adapt the SAP S/4HANA Cloud Private Edition with built-in and side-by-side extension capabilities.

Sourcing & Procurement

I_PurchaseOrderHistoryAPI01 is a Composite CDS View that provides data about "Purchase Order History" in SAP S/4HANA. It reads from 1 data source (I_PurchaseOrderHistoryBasic) and exposes 58 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber, PurchasingHistoryDocumentType, PurchasingHistoryDocumentYear. It has 2 associations to related views.

SAP Help Documentation

CategoryCDS Views for Purchase Orders
Purpose
This CDS view helps to retrieve a history of all the transactions that have occurred referring to a purchase order item to date (for example goods and invoice receipts relating to the item, incurrence of delivery costs, down-payments, and so on). To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views .

Prerequisites
Authorizations Users who want to use this CDS view must have the following authorization objects assigned: M_BEST_BSA (Document type in purchase order) M_BEST_EKO (Purchasing organization in purchase order) M_BEST_EKG (Purchasing group in purchase order) M_BEST_WRK (Plant in purchase order)

Structure
Important Fields Important fields in this view include the following: Field Name Description PurchaseOrder Purchase order number PurchaseOrderItem Item number in purchase order AccountAssignmentNumber Sequential number of account assignment PurchasingHistoryDocumentType Transaction /event type, purchase order history PurchasingHistoryDocumentYear Material document year PurchasingHistoryDocument Number of material document PurchasingHistoryDocumentItem Item in material document PurchasingHistoryCategory Purchase order history category GoodsMovementType Movement type (inventory management) PostingDatte posting date in the document Currency Currency key (purchase order currency) DebitCreditCode Debit/credit indicator IsCompletelyDelivered Delivery completed indicator ReferenceDocumentFiscalYear Fiscal year of a reference document ReferenceDocument Document number of a reference document ReferenceDocumentItem Item of a reference document Material Material number Plant Plant RvslOfGoodsReceiptIs Allowed Reversal of GR allowed for GR-based IV despite invoice PricingDocument Number of the document condition TaxCode Tax on sales / purchase code DocumentDate Document date in document InventoryValuationType Valuation type DocumentReferenceID Reference document number DeliveryQuantityUnit Unit of measure from delivery note ManufacturerMaterial Material number AccountingDocumentCreationDate Day on which accounting document was entered PurgHistDocumentCreationTime Time of entry Quantity Quantity PurOrdAmountInCompanyCodeCrcy Amount in local currency PurchaseOrderAmount Amount in document currency QtyInPurchaseOrderPriceUnit Quantity in purchase order price unit GRIRAcctClrgAmtInCoCodeCrcy GR/IR account clearing value in local currency GdsRcptBlkdStkQtyInOrdQtyUnit Goods receipt blocked stock in order unit GdsRcptBlkdStkQtyInOrdPrcUnit Quantity in GR blocked stock in order price unit InvoiceAmtInCocodeCrcy Invoice value entered (in local currency) ShipgInstrnSupplierCompliance Compliance with shipping instructions InvoiceAmountInFrgnCurrency Invoice value in foreign currency QuantityInDeliveryQtyUnit Quantity in unit of measure from delivery note GRIRAcctClrgAmtInTransacCrcy Clearing value on GR/IR clearing account (transactual currency) QuantityInBaseUnit Quantity Batch Batch number GRIRAcctClrgAmtInOrdTrnsacCrcy Clearing value on GR/IR account in purchase order currency InvoiceAmtInPurOrdTransacCrcy Invoice amount in purchase order currency VltdGdsRcptBlkdStkQtyInOrdUnit Valuated goods receipt blocked stock in order unit VltdGdsRcptBlkdQtyInOrdPrcUnit Quantity in valuated GR blocked stock in order price unit IsToBeAcceptedAtOrigin Acceptance At Origin ExchangeRateDifferenceAmount Exchange rate difference amount ExchangeRate Exchange rate DeliveryDocument Delivery DeliveryDocumentItem Delivery item OrderPriceUnit Order price unit (purchasing) PurchaseOrderQuantiyUnit Purchase order unit of measure BaseUnit Base unit of measure DocumentCurren

View on SAP Help Portal →

SAP API Hub

StateC1
Line of BusinessSourcing & Procurement
Application ComponentMM-PUR-PO
CapabilitiesData Source in SQL Select, Association Target for Defining CDS Entities, Data Source for Defining CDS Entities
PackageSourcing & Procurement for SAP S/4HANA Cloud Private Edition
Description <p>This CDS view helps to retrieve a history of all the transactions that have occurred referring to a purchase order item to date (for example goods and invoice receipts relating to the item, incurrence of delivery costs, down-payments, and so on).</p> <p>To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views.</p>

Documentation

Data Sources (1)

SourceAliasJoin Type
I_PurchaseOrderHistoryBasic history from

Associations (2)

CardinalityTargetAliasCondition
[1..1] I_PurchaseOrderAPI01 _PurchaseOrder $projection.PurchaseOrder = _PurchaseOrder.PurchaseOrder
[1..1] I_PurchaseOrderItemAPI01 _PurchaseOrderItem $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder and $projection.PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem

Annotations (12)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.sqlViewName IMMPURORDHISAP01 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
Metadata.ignorePropagatedAnnotations true view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view

Fields (58)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder I_PurchaseOrderHistoryBasic PurchaseOrder Purchasing Document Number
KEY PurchaseOrderItem PurchaseOrderItem Item Number of Purchasing Document
KEY AccountAssignmentNumber AccountAssignmentNumber Sequential Number of Account Assignment
KEY PurchasingHistoryDocumentType PurchasingHistoryDocumentType Transaction/event type, purchase order history
KEY PurchasingHistoryDocumentYear PurchasingHistoryDocumentYear Material Document Year
KEY PurchasingHistoryDocument PurchasingHistoryDocument Number of Material Document
KEY PurchasingHistoryDocumentItem PurchasingHistoryDocumentItem Item in Material Document
PurchasingHistoryCategory PurchasingHistoryCategory Purchase Order History Category
GoodsMovementType GoodsMovementType Movement Type (Inventory Management)
PostingDate PostingDate Posting Date in the Document
Currency Currency Valuation Crcy
DebitCreditCode DebitCreditCode Debit/Credit Indicator
IsCompletelyDelivered IsCompletelyDelivered "Delivery Completed" Indicator
ReferenceDocumentFiscalYear ReferenceDocumentFiscalYear Fiscal Year of a Reference Document
ReferenceDocument ReferenceDocument Document No. of a Reference Document
ReferenceDocumentItem ReferenceDocumentItem Item of a Reference Document
Material Material Material Number
Plant Plant Valuation Area
RvslOfGoodsReceiptIsAllowed RvslOfGoodsReceiptIsAllowed Reversal of GR allowed for GR-based IV despite invoice
PricingDocument PricingDocument Number of the Document Condition
TaxCode TaxCode Tax on sales/purchases code
DocumentDate DocumentDate Document Date in Document
InventoryValuationType InventoryValuationType Valuation Type
DocumentReferenceID DocumentReferenceID Reference Document Number
DeliveryQuantityUnit DeliveryQuantityUnit Unit of Measure From Delivery Note
ManufacturerMaterial ManufacturerMaterial Material number
AccountingDocumentCreationDate AccountingDocumentCreationDate Day On Which Accounting Document Was Entered
PurgHistDocumentCreationTime PurgHistDocumentCreationTime Time of Entry
Quantity Quantity Quantity
PurOrdAmountInCompanyCodeCrcy PurOrdAmountInCompanyCodeCrcy Amount in Local Currency
PurchaseOrderAmount PurchaseOrderAmount Amount in Document Currency
QtyInPurchaseOrderPriceUnit QtyInPurchaseOrderPriceUnit Quantity in purchase order price unit
GRIRAcctClrgAmtInCoCodeCrcy GRIRAcctClrgAmtInCoCodeCrcy GR/IR account clearing value in local currency
GdsRcptBlkdStkQtyInOrdQtyUnit GdsRcptBlkdStkQtyInOrdQtyUnit Goods Receipt Blocked Stock in Order Unit
GdsRcptBlkdStkQtyInOrdPrcUnit GdsRcptBlkdStkQtyInOrdPrcUnit Quantity in GR blocked stock in order price unit
InvoiceAmtInCoCodeCrcy InvoiceAmtInCoCodeCrcy Invoice Value Entered (in Local Currency)
ShipgInstrnSupplierCompliance ShipgInstrnSupplierCompliance Compliance with Shipping Instructions
InvoiceAmountInFrgnCurrency InvoiceAmountInFrgnCurrency Invoice Value in Foreign Currency
QuantityInDeliveryQtyUnit QuantityInDeliveryQtyUnit Quantity in Unit of Measure from Delivery Note
GRIRAcctClrgAmtInTransacCrcy GRIRAcctClrgAmtInTransacCrcy Clearing value on GR/IR clearing account (transac. currency)
QuantityInBaseUnit QuantityInBaseUnit Quantity
Batch Batch Batch Number
GRIRAcctClrgAmtInOrdTrnsacCrcy GRIRAcctClrgAmtInOrdTrnsacCrcy Clearing Value on GR/IR Account in PO Currency
InvoiceAmtInPurOrdTransacCrcy InvoiceAmtInPurOrdTransacCrcy Invoice Amount in PO Currency
VltdGdsRcptBlkdStkQtyInOrdUnit VltdGdsRcptBlkdStkQtyInOrdUnit Valuated Goods Receipt Blocked Stock in Order Unit
VltdGdsRcptBlkdQtyInOrdPrcUnit VltdGdsRcptBlkdQtyInOrdPrcUnit Quantity in Valuated GR Blocked Stock in Order Price Unit
IsToBeAcceptedAtOrigin IsToBeAcceptedAtOrigin Acceptance At Origin
ExchangeRateDifferenceAmount ExchangeRateDifferenceAmount Exchange Rate Difference Amount
ExchangeRate I_PurchaseOrderHistoryBasic ExchangeRate Exchange rate
DeliveryDocument DeliveryDocument Outbound Delivery
DeliveryDocumentItem DeliveryDocumentItem Outb. Delivery Item
OrderPriceUnit OrderPriceUnit Order Price Unit (Purchasing)
PurchaseOrderQuantityUnit PurchaseOrderQuantityUnit Purchase Order Unit of Measure
BaseUnit BaseUnit Base Unit of Measure
DocumentCurrency DocumentCurrency Document Currency
CompanyCodeCurrency 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_PurchaseOrderHistoryAPI01.
-- 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: IMMPURORDHISAP01

CREATE VIEW I_PurchaseOrderHistoryAPI01 AS
SELECT
  history.PurchaseOrder AS PurchaseOrder,
  PurchaseOrderItem,
  AccountAssignmentNumber,
  PurchasingHistoryDocumentType,
  PurchasingHistoryDocumentYear,
  PurchasingHistoryDocument,
  PurchasingHistoryDocumentItem,
  PurchasingHistoryCategory,
  GoodsMovementType,
  PostingDate,
  Currency,
  DebitCreditCode,
  IsCompletelyDelivered,
  ReferenceDocumentFiscalYear,
  ReferenceDocument,
  ReferenceDocumentItem,
  Material,
  Plant,
  RvslOfGoodsReceiptIsAllowed,
  PricingDocument,
  TaxCode,
  DocumentDate,
  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,
  PurchaseOrderQuantityUnit,
  BaseUnit,
  DocumentCurrency,
  CompanyCodeCurrency
FROM I_PurchaseOrderHistoryBasic AS history
LEFT OUTER JOIN I_PurchaseOrderAPI01 AS _PurchaseOrder ON PurchaseOrder = _PurchaseOrder.PurchaseOrder  -- association [1..1]
LEFT OUTER JOIN I_PurchaseOrderItemAPI01 AS _PurchaseOrderItem ON PurchaseOrder = _PurchaseOrderItem.PurchaseOrder AND PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem  -- association [1..1]
;