I_PurchaseOrderHistory
Purchase Order History
I_PurchaseOrderHistory is a Basic CDS View that provides data about "Purchase Order History" in SAP S/4HANA. It reads from 1 data source (P_PurchaseOrderHistory2) and exposes 57 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber, PurchaseOrderTransactionType, MaterialDocumentYear. It has 3 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_PurchaseOrderHistory2 | union_EKBE_EKBEH | from |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_PurchaseOrder | _PurchaseOrder | union_EKBE_EKBEH.ebeln = _PurchaseOrder.PurchaseOrder |
| [1..1] | I_PurchaseOrderHistCategory | _PurchaseOrderHistCategory | $projection.PurchaseOrderHistCategory = _PurchaseOrderHistCategory.PurchaseOrderHistCategory |
| [1..1] | I_PurchaseOrderItem | _PurchaseOrderItem | $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder and $projection.PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem |
Annotations (13)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.preserveKey | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| AbapCatalog.sqlViewName | IMMPURORDERHIST | view | |
| EndUserText.label | Purchase Order History | view | |
| VDM.viewType | #BASIC | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| VDM.lifecycle.contract.type | #SAP_INTERNAL_API | view | |
| VDM.lifecycle.status | #DEPRECATED | view | |
| VDM.lifecycle.successor | I_PurchaseOrderHistoryBasic | view |
Fields (57)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | |||
| KEY | PurchaseOrderItem | |||
| KEY | AccountAssignmentNumber | P_PurchaseOrderHistory2 | zekkn | Account Assgmt No. |
| KEY | PurchaseOrderTransactionType | P_PurchaseOrderHistory2 | vgabe | Transact. Type |
| KEY | MaterialDocumentYear | P_PurchaseOrderHistory2 | gjahr | Settlement Year |
| KEY | MaterialDocument | P_PurchaseOrderHistory2 | belnr | SD Document |
| KEY | MaterialDocumentItem | P_PurchaseOrderHistory2 | buzei | Posting View Item |
| PurchaseOrderHistCategory | P_PurchaseOrderHistory2 | bewtp | PO History Cat. | |
| SubsequentDebitCreditIsAllowed | _PurchaseOrderHistCategory | SubsequentDebitCreditIsAllowed | ||
| GoodsMovementType | P_PurchaseOrderHistory2 | bwart | Valuation Type | |
| PostingDate | P_PurchaseOrderHistory2 | budat | Posting Date | |
| Currency | P_PurchaseOrderHistory2 | waers | Transaction Currency | |
| DebitCreditCode | P_PurchaseOrderHistory2 | shkzg | Returns | |
| IsCompletelyDelivered | P_PurchaseOrderHistory2 | elikz | Delivery Completion | |
| ReferenceDocumentFiscalYear | P_PurchaseOrderHistory2 | lfgja | Year Cur.Period | |
| ReferenceDocument | P_PurchaseOrderHistory2 | lfbnr | Reference Doc. | |
| ReferenceDocumentItem | P_PurchaseOrderHistory2 | lfpos | Ref. Doc. Item | |
| Material | P_PurchaseOrderHistory2 | matnr | Vehicle Model | |
| Plant | P_PurchaseOrderHistory2 | werks | Receiving Plant | |
| RvslOfGoodsReceiptIsAllowed | P_PurchaseOrderHistory2 | xwsbr | RevGR desp. IR | |
| PricingDocument | P_PurchaseOrderHistory2 | knumv | Doc. Condition | |
| TaxCode | P_PurchaseOrderHistory2 | mwskz | Tax Code | |
| DocumentDate | P_PurchaseOrderHistory2 | bldat | Journal Entry Date | |
| InventoryValuationType | P_PurchaseOrderHistory2 | bwtar | Valuation Type | |
| DocumentReferenceID | P_PurchaseOrderHistory2 | xblnr | Reference | |
| DeliveryQuantityUnit | P_PurchaseOrderHistory2 | lsmeh | Del. Note Unit | |
| ManufacturerMaterial | P_PurchaseOrderHistory2 | ematn | MPN: Material | |
| AccountingDocumentCreationDate | P_PurchaseOrderHistory2 | cpudt | Imported On | |
| Quantity | P_PurchaseOrderHistory2 | menge | WarrCountValue | |
| PurOrdAmountInCompanyCodeCrcy | P_PurchaseOrderHistory2 | dmbtr | Loc. amount | |
| PurchaseOrderAmount | P_PurchaseOrderHistory2 | wrbtr | Gross Amount | |
| QtyInPurchaseOrderPriceUnit | P_PurchaseOrderHistory2 | bpmng | Qty. in OPUn | |
| GRIRAcctClrgAmtInCoCodeCrcy | P_PurchaseOrderHistory2 | arewr | Ord.GRIR.Val | |
| GdsRcptBlkdStkQtyInOrdQtyUnit | P_PurchaseOrderHistory2 | wesbs | GR Bl.St. OUn | |
| GdsRcptBlkdStkQtyInOrdPrcUnit | P_PurchaseOrderHistory2 | bpwes | GR blocked stck | |
| InvoiceAmtInCoCodeCrcy | P_PurchaseOrderHistory2 | reewr | Ord.Set.Value | |
| ShipgInstrnSupplierCompliance | P_PurchaseOrderHistory2 | evere | Compliance | |
| InvoiceAmountInFrgnCurrency | P_PurchaseOrderHistory2 | refwr | Inv.Value in FC | |
| QuantityInDeliveryQtyUnit | P_PurchaseOrderHistory2 | lsmng | Del. Note Qty | |
| GRIRAcctClrgAmtInTransacCrcy | P_PurchaseOrderHistory2 | areww | GR/IR clr.value | |
| QuantityInBaseUnit | P_PurchaseOrderHistory2 | bamng | Quantity | |
| GRIRAcctClrgAmtInOrdTrnsacCrcy | P_PurchaseOrderHistory2 | arewb | GR/IR clr.value | |
| InvoiceAmtInPurOrdTransacCrcy | P_PurchaseOrderHistory2 | rewrb | FC invoice amnt | |
| VltdGdsRcptBlkdStkQtyInOrdUnit | P_PurchaseOrderHistory2 | wesbb | Val. GR BlStock OUn | |
| VltdGdsRcptBlkdQtyInOrdPrcUnit | P_PurchaseOrderHistory2 | bpweb | Val. GR BS OPUn | |
| IsToBeAcceptedAtOrigin | P_PurchaseOrderHistory2 | weora | Origin Accept. | |
| ExchangeRateDifferenceAmount | P_PurchaseOrderHistory2 | kudif | Exch.Rate Diff. | |
| ExchangeRate | ||||
| ebeln | ebeln | Source PurchDoc | ||
| ebelp | ebelp | Item pur. doc. | ||
| _PurchaseOrderItem | _PurchaseOrderItem | |||
| _PurchaseOrderHistCategory | _PurchaseOrderHistCategory | |||
| DocumentCurrency | _PurchaseOrder | DocumentCurrency | Document Currency | |
| OrderPriceUnit | _PurchaseOrderItem | OrderPriceUnit | Order Price Un. | |
| PurchaseOrderQuantityUnit | _PurchaseOrderItem | PurchaseOrderQuantityUnit | Order Unit | |
| BaseUnit | _PurchaseOrderItem | BaseUnit | Unit of Measure | |
| CompanyCodeCurrency |
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_PurchaseOrderHistory.
-- 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: IMMPURORDERHIST
CREATE VIEW I_PurchaseOrderHistory AS
SELECT
cast( union_EKBE_EKBEH.ebeln as vdm_purchaseorder preserving type ) AS PurchaseOrder,
cast( union_EKBE_EKBEH.ebelp as vdm_purchaseorderitem preserving type ) AS PurchaseOrderItem,
union_EKBE_EKBEH.zekkn AS AccountAssignmentNumber,
union_EKBE_EKBEH.vgabe AS PurchaseOrderTransactionType,
union_EKBE_EKBEH.gjahr AS MaterialDocumentYear,
union_EKBE_EKBEH.belnr AS MaterialDocument,
union_EKBE_EKBEH.buzei AS MaterialDocumentItem,
union_EKBE_EKBEH.bewtp AS PurchaseOrderHistCategory,
_PurchaseOrderHistCategory.SubsequentDebitCreditIsAllowed AS SubsequentDebitCreditIsAllowed,
union_EKBE_EKBEH.bwart AS GoodsMovementType,
union_EKBE_EKBEH.budat AS PostingDate,
union_EKBE_EKBEH.waers AS Currency,
union_EKBE_EKBEH.shkzg AS DebitCreditCode,
union_EKBE_EKBEH.elikz AS IsCompletelyDelivered,
union_EKBE_EKBEH.lfgja AS ReferenceDocumentFiscalYear,
union_EKBE_EKBEH.lfbnr AS ReferenceDocument,
union_EKBE_EKBEH.lfpos AS ReferenceDocumentItem,
union_EKBE_EKBEH.matnr AS Material,
union_EKBE_EKBEH.werks AS Plant,
union_EKBE_EKBEH.xwsbr AS RvslOfGoodsReceiptIsAllowed,
union_EKBE_EKBEH.knumv AS PricingDocument,
union_EKBE_EKBEH.mwskz AS TaxCode,
union_EKBE_EKBEH.bldat AS DocumentDate,
union_EKBE_EKBEH.bwtar AS InventoryValuationType,
union_EKBE_EKBEH.xblnr AS DocumentReferenceID,
union_EKBE_EKBEH.lsmeh AS DeliveryQuantityUnit,
union_EKBE_EKBEH.ematn AS ManufacturerMaterial,
union_EKBE_EKBEH.cpudt AS AccountingDocumentCreationDate,
union_EKBE_EKBEH.menge AS Quantity,
union_EKBE_EKBEH.dmbtr AS PurOrdAmountInCompanyCodeCrcy,
union_EKBE_EKBEH.wrbtr AS PurchaseOrderAmount,
union_EKBE_EKBEH.bpmng AS QtyInPurchaseOrderPriceUnit,
union_EKBE_EKBEH.arewr AS GRIRAcctClrgAmtInCoCodeCrcy,
union_EKBE_EKBEH.wesbs AS GdsRcptBlkdStkQtyInOrdQtyUnit,
union_EKBE_EKBEH.bpwes AS GdsRcptBlkdStkQtyInOrdPrcUnit,
union_EKBE_EKBEH.reewr AS InvoiceAmtInCoCodeCrcy,
union_EKBE_EKBEH.evere AS ShipgInstrnSupplierCompliance,
union_EKBE_EKBEH.refwr AS InvoiceAmountInFrgnCurrency,
union_EKBE_EKBEH.lsmng AS QuantityInDeliveryQtyUnit,
union_EKBE_EKBEH.areww AS GRIRAcctClrgAmtInTransacCrcy,
union_EKBE_EKBEH.bamng AS QuantityInBaseUnit,
union_EKBE_EKBEH.arewb AS GRIRAcctClrgAmtInOrdTrnsacCrcy,
union_EKBE_EKBEH.rewrb AS InvoiceAmtInPurOrdTransacCrcy,
union_EKBE_EKBEH.wesbb AS VltdGdsRcptBlkdStkQtyInOrdUnit,
union_EKBE_EKBEH.bpweb AS VltdGdsRcptBlkdQtyInOrdPrcUnit,
union_EKBE_EKBEH.weora AS IsToBeAcceptedAtOrigin,
union_EKBE_EKBEH.kudif AS ExchangeRateDifferenceAmount,
cast (union_EKBE_EKBEH.wkurs as fis_exchange_rate) AS ExchangeRate,
ebeln,
ebelp,
_PurchaseOrder.DocumentCurrency AS DocumentCurrency,
_PurchaseOrderItem.OrderPriceUnit AS OrderPriceUnit,
_PurchaseOrderItem.PurchaseOrderQuantityUnit AS PurchaseOrderQuantityUnit,
_PurchaseOrderItem.BaseUnit AS BaseUnit,
_PurchaseOrder._CompanyCode.Currency AS CompanyCodeCurrency
FROM P_PurchaseOrderHistory2 AS union_EKBE_EKBEH
LEFT OUTER JOIN I_PurchaseOrder AS _PurchaseOrder ON union_EKBE_EKBEH.ebeln = _PurchaseOrder.PurchaseOrder -- association [1..1]
LEFT OUTER JOIN I_PurchaseOrderHistCategory AS _PurchaseOrderHistCategory ON PurchaseOrderHistCategory = _PurchaseOrderHistCategory.PurchaseOrderHistCategory -- association [1..1]
LEFT OUTER JOIN I_PurchaseOrderItem AS _PurchaseOrderItem ON PurchaseOrder = _PurchaseOrderItem.PurchaseOrder AND PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem -- association [1..1]
;
Learn More
- S/4HANA CDS View Deprecation: What You Need to Know
- 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
- 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