I_PurchasingDocumentHistory

DDL: I_PURCHASINGDOCUMENTHISTORY SQL: IMMPURDOCHIST Type: view COMPOSITE

Purchasing Document History

I_PurchasingDocumentHistory is a Composite CDS View that provides data about "Purchasing Document History" in SAP S/4HANA. It reads from 2 data sources (I_PurchasingDocumentHistoryBsc, I_PurgDocRemovedHistory) and exposes 113 fields with key fields PurchasingDocument, PurchasingDocumentItem, AccountAssignmentNumber, PurchasingHistoryDocumentType, PurchasingHistoryDocumentYear. It has 2 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_PurchasingDocumentHistoryBsc HistoryBsc from
I_PurgDocRemovedHistory RemovedHistory union_all

Associations (2)

CardinalityTargetAliasCondition
[1..1] I_PurchasingDocument _PurchasingDocument $projection.PurchasingDocument = _PurchasingDocument.PurchasingDocument
[1..1] I_PurchasingDocumentItem _PurchasingDocumentItem $projection.PurchasingDocument = _PurchasingDocumentItem.PurchasingDocument and $projection.PurchasingDocumentItem = _PurchasingDocumentItem.PurchasingDocumentItem

Annotations (12)

NameValueLevelField
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.sqlViewName IMMPURDOCHIST view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
EndUserText.label Purchasing Document History view
VDM.viewType #COMPOSITE view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view

Fields (113)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocument I_PurchasingDocumentHistoryBsc PurchasingDocument Purchasing Document
KEY PurchasingDocumentItem I_PurchasingDocumentHistoryBsc PurchasingDocumentItem Purchasing Doc. Item
KEY AccountAssignmentNumber I_PurchasingDocumentHistoryBsc AccountAssignmentNumber Account Assgmt No.
KEY PurchasingHistoryDocumentType I_PurchasingDocumentHistoryBsc PurchasingHistoryDocumentType Transact. Type
KEY PurchasingHistoryDocumentYear I_PurchasingDocumentHistoryBsc PurchasingHistoryDocumentYear Settlement Year
KEY PurchasingHistoryDocument I_PurchasingDocumentHistoryBsc PurchasingHistoryDocument SD Document
KEY PurchasingHistoryDocumentItem I_PurchasingDocumentHistoryBsc PurchasingHistoryDocumentItem Posting View Item
PurchasingHistoryCategory I_PurchasingDocumentHistoryBsc PurchasingHistoryCategory PO History Cat.
GoodsMovementType I_PurchasingDocumentHistoryBsc GoodsMovementType Movement Type
PostingDate I_PurchasingDocumentHistoryBsc PostingDate Posting Date for GR
Currency I_PurchasingDocumentHistoryBsc Currency Valuation Crcy
DebitCreditCode I_PurchasingDocumentHistoryBsc DebitCreditCode Single-Character Flag
IsCompletelyDelivered I_PurchasingDocumentHistoryBsc IsCompletelyDelivered Is completely delivered
ReferenceDocumentFiscalYear I_PurchasingDocumentHistoryBsc ReferenceDocumentFiscalYear Year Cur.Period
ReferenceDocument I_PurchasingDocumentHistoryBsc InvtryMgmtReferenceDocument Reference Doc.
ReferenceDocumentItem I_PurchasingDocumentHistoryBsc InvtryMgmtRefDocumentItem Ref. Doc. Item
Material I_PurchasingDocumentHistoryBsc Material Vehicle Model
Plant I_PurchasingDocumentHistoryBsc Plant Valuation Area
RvslOfGoodsReceiptIsAllowed I_PurchasingDocumentHistoryBsc RvslOfGoodsReceiptIsAllowed RevGR desp. IR
PricingDocument I_PurchasingDocumentHistoryBsc PricingDocument Document Condition
TaxCode I_PurchasingDocumentHistoryBsc TaxCode Tax Code
DocumentDate I_PurchasingDocumentHistoryBsc DocumentDate Journal Entry Date
CreatedByUser I_PurchasingDocumentHistoryBsc CreatedByUser User Name
InventoryValuationType I_PurchasingDocumentHistoryBsc InventoryValuationType Valuation Type
DocumentReferenceID I_PurchasingDocumentHistoryBsc DocumentReferenceID Reference
DeliveryQuantityUnit I_PurchasingDocumentHistoryBsc DeliveryQuantityUnit Unit of measure
ManufacturerMaterial I_PurchasingDocumentHistoryBsc ManufacturerMaterial MPN: Material
AccountingDocumentCreationDate I_PurchasingDocumentHistoryBsc AccountingDocumentCreationDate Journal Entry Date
PurgHistDocumentCreationTime I_PurchasingDocumentHistoryBsc PurgHistDocumentCreationTime Time
Quantity I_PurchasingDocumentHistoryBsc Quantity Value
PurOrdAmountInCompanyCodeCrcy I_PurchasingDocumentHistoryBsc PurOrdAmountInCompanyCodeCrcy Loc. amount
PurchaseOrderAmount I_PurchasingDocumentHistoryBsc PurchaseOrderAmount Gross Amount
QtyInPurchaseOrderPriceUnit I_PurchasingDocumentHistoryBsc QtyInPurchaseOrderPriceUnit Qty in OPUn
GRIRAcctClrgAmtInCoCodeCrcy I_PurchasingDocumentHistoryBsc GRIRAcctClrgAmtInCoCodeCrcy Ord.GRIR.Val
GdsRcptBlkdStkQtyInOrdQtyUnit I_PurchasingDocumentHistoryBsc GdsRcptBlkdStkQtyInOrdQtyUnit GR Bl.St. OUn
GdsRcptBlkdStkQtyInOrdPrcUnit I_PurchasingDocumentHistoryBsc GdsRcptBlkdStkQtyInOrdPrcUnit GR blocked stck
InvoiceAmtInCoCodeCrcy I_PurchasingDocumentHistoryBsc InvoiceAmtInCoCodeCrcy Ord.Set.Value
ShipgInstrnSupplierCompliance I_PurchasingDocumentHistoryBsc ShipgInstrnSupplierCompliance Compliance
InvoiceAmountInFrgnCurrency I_PurchasingDocumentHistoryBsc InvoiceAmountInFrgnCurrency Invc. Amt Frgn Crcy
QuantityInDeliveryQtyUnit I_PurchasingDocumentHistoryBsc QuantityInDeliveryQtyUnit Del. Note Qty
GRIRAcctClrgAmtInTransacCrcy I_PurchasingDocumentHistoryBsc GRIRAcctClrgAmtInTransacCrcy GR/IR clr.value
QuantityInBaseUnit I_PurchasingDocumentHistoryBsc QuantityInBaseUnit Quantity
Batch I_PurchasingDocumentHistoryBsc Batch Lot No.
GRIRAcctClrgAmtInOrdTrnsacCrcy I_PurchasingDocumentHistoryBsc GRIRAcctClrgAmtInOrdTrnsacCrcy GR/IR clr.value
InvoiceAmtInPurOrdTransacCrcy I_PurchasingDocumentHistoryBsc InvoiceAmtInPurOrdTransacCrcy FC invoice amnt
VltdGdsRcptBlkdStkQtyInOrdUnit I_PurchasingDocumentHistoryBsc VltdGdsRcptBlkdStkQtyInOrdUnit Val. GR BlStock OUn
VltdGdsRcptBlkdQtyInOrdPrcUnit I_PurchasingDocumentHistoryBsc VltdGdsRcptBlkdQtyInOrdPrcUnit Val. GR BS OPUn
IsToBeAcceptedAtOrigin I_PurchasingDocumentHistoryBsc IsToBeAcceptedAtOrigin Origin Accept.
ExchangeRateDifferenceAmount I_PurchasingDocumentHistoryBsc ExchangeRateDifferenceAmount Exch.Rate Diff.
ExchangeRate I_PurchasingDocumentHistoryBsc ExchangeRate Exchange rate
DeliveryDocument I_PurchasingDocumentHistoryBsc DeliveryDocument Outbound Delivery
DeliveryDocumentItem I_PurchasingDocumentHistoryBsc DeliveryDocumentItem Outb. Delivery Item
OrderPriceUnit OrderPriceUnit Order Price Un.
OrderQuantityUnit OrderQuantityUnit Sales Unit
BaseUnit BaseUnit Unit of Measure
DocumentCurrency PurchasingDocumentCurrency Document Currency
PurchasingDocument Purchasing Document
KEY PurchasingDocumentItem I_PurgDocRemovedHistory PurchasingDocumentItem Purchasing Doc. Item
KEY AccountAssignmentNumber I_PurgDocRemovedHistory AccountAssignmentNumber Account Assgmt No.
KEY PurchasingHistoryDocumentType I_PurgDocRemovedHistory PurchasingHistoryDocumentType Transact. Type
KEY PurchasingHistoryDocumentYear I_PurgDocRemovedHistory PurchasingHistoryDocumentYear Settlement Year
KEY PurchasingHistoryDocument I_PurgDocRemovedHistory PurchasingHistoryDocument SD Document
KEY PurchasingHistoryDocumentItem I_PurgDocRemovedHistory PurchasingHistoryDocumentItem Posting View Item
PurchasingHistoryCategory I_PurgDocRemovedHistory PurchasingHistoryCategory PO History Cat.
GoodsMovementType I_PurgDocRemovedHistory GoodsMovementType Movement Type
PostingDate I_PurgDocRemovedHistory PostingDate Posting Date for GR
Currency I_PurgDocRemovedHistory Currency Valuation Crcy
DebitCreditCode I_PurgDocRemovedHistory DebitCreditCode Single-Character Flag
IsCompletelyDelivered I_PurgDocRemovedHistory IsCompletelyDelivered Is completely delivered
ReferenceDocumentFiscalYear I_PurgDocRemovedHistory ReferenceDocumentFiscalYear Year Cur.Period
ReferenceDocument I_PurgDocRemovedHistory InvtryMgmtReferenceDocument Reference Doc.
ReferenceDocumentItem I_PurgDocRemovedHistory InvtryMgmtRefDocumentItem Ref. Doc. Item
Material I_PurgDocRemovedHistory Material Vehicle Model
Plant I_PurgDocRemovedHistory Plant Valuation Area
RvslOfGoodsReceiptIsAllowed I_PurgDocRemovedHistory RvslOfGoodsReceiptIsAllowed RevGR desp. IR
PricingDocument I_PurgDocRemovedHistory PricingDocument Document Condition
TaxCode I_PurgDocRemovedHistory TaxCode Tax Code
DocumentDate I_PurgDocRemovedHistory DocumentDate Journal Entry Date
CreatedByUser I_PurgDocRemovedHistory CreatedByUser User Name
InventoryValuationType I_PurgDocRemovedHistory InventoryValuationType Valuation Type
DocumentReferenceID I_PurgDocRemovedHistory DocumentReferenceID Reference
DeliveryQuantityUnit I_PurgDocRemovedHistory DeliveryQuantityUnit Unit of measure
ManufacturerMaterial I_PurgDocRemovedHistory ManufacturerMaterial MPN: Material
AccountingDocumentCreationDate I_PurgDocRemovedHistory AccountingDocumentCreationDate Journal Entry Date
PurgHistDocumentCreationTime I_PurgDocRemovedHistory PurgHistDocumentCreationTime Time
Quantity I_PurgDocRemovedHistory Quantity Value
PurOrdAmountInCompanyCodeCrcy I_PurgDocRemovedHistory PurOrdAmountInCompanyCodeCrcy Loc. amount
PurchaseOrderAmount I_PurgDocRemovedHistory PurchaseOrderAmount Gross Amount
QtyInPurchaseOrderPriceUnit I_PurgDocRemovedHistory QtyInPurchaseOrderPriceUnit Qty in OPUn
GRIRAcctClrgAmtInCoCodeCrcy I_PurgDocRemovedHistory GRIRAcctClrgAmtInCoCodeCrcy Ord.GRIR.Val
GdsRcptBlkdStkQtyInOrdQtyUnit I_PurgDocRemovedHistory GdsRcptBlkdStkQtyInOrdQtyUnit GR Bl.St. OUn
GdsRcptBlkdStkQtyInOrdPrcUnit I_PurgDocRemovedHistory GdsRcptBlkdStkQtyInOrdPrcUnit GR blocked stck
InvoiceAmtInCoCodeCrcy I_PurgDocRemovedHistory InvoiceAmtInCoCodeCrcy Ord.Set.Value
ShipgInstrnSupplierCompliance I_PurgDocRemovedHistory ShipgInstrnSupplierCompliance Compliance
InvoiceAmountInFrgnCurrency I_PurgDocRemovedHistory InvoiceAmountInFrgnCurrency Invc. Amt Frgn Crcy
QuantityInDeliveryQtyUnit I_PurgDocRemovedHistory QuantityInDeliveryQtyUnit Del. Note Qty
GRIRAcctClrgAmtInTransacCrcy I_PurgDocRemovedHistory GRIRAcctClrgAmtInTransacCrcy GR/IR clr.value
QuantityInBaseUnit I_PurgDocRemovedHistory QuantityInBaseUnit Quantity
Batch I_PurgDocRemovedHistory Batch Lot No.
GRIRAcctClrgAmtInOrdTrnsacCrcy I_PurgDocRemovedHistory GRIRAcctClrgAmtInOrdTrnsacCrcy GR/IR clr.value
InvoiceAmtInPurOrdTransacCrcy I_PurgDocRemovedHistory InvoiceAmtInPurOrdTransacCrcy FC invoice amnt
VltdGdsRcptBlkdStkQtyInOrdUnit I_PurgDocRemovedHistory VltdGdsRcptBlkdStkQtyInOrdUnit Val. GR BlStock OUn
VltdGdsRcptBlkdQtyInOrdPrcUnit I_PurgDocRemovedHistory VltdGdsRcptBlkdQtyInOrdPrcUnit Val. GR BS OPUn
IsToBeAcceptedAtOrigin I_PurgDocRemovedHistory IsToBeAcceptedAtOrigin Origin Accept.
ExchangeRateDifferenceAmount I_PurgDocRemovedHistory ExchangeRateDifferenceAmount Exch.Rate Diff.
ExchangeRate I_PurgDocRemovedHistory ExchangeRate Exchange rate
DeliveryDocument I_PurgDocRemovedHistory DeliveryDocument Outbound Delivery
DeliveryDocumentItem I_PurgDocRemovedHistory DeliveryDocumentItem Outb. Delivery Item
OrderPriceUnit OrderPriceUnit Order Price Un.
OrderQuantityUnit OrderQuantityUnit Sales Unit
BaseUnit BaseUnit Unit of Measure
DocumentCurrency PurchasingDocumentCurrency Document Currency
CompanyCodeCurrency CompanyCodeCurrency Local Currency

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_PurchasingDocumentHistory.
-- 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: IMMPURDOCHIST

CREATE VIEW I_PurchasingDocumentHistory AS
SELECT
  HistoryBsc.PurchasingDocument AS PurchasingDocument,
  HistoryBsc.PurchasingDocumentItem AS PurchasingDocumentItem,
  HistoryBsc.AccountAssignmentNumber AS AccountAssignmentNumber,
  HistoryBsc.PurchasingHistoryDocumentType AS PurchasingHistoryDocumentType,
  HistoryBsc.PurchasingHistoryDocumentYear AS PurchasingHistoryDocumentYear,
  HistoryBsc.PurchasingHistoryDocument AS PurchasingHistoryDocument,
  HistoryBsc.PurchasingHistoryDocumentItem AS PurchasingHistoryDocumentItem,
  HistoryBsc.PurchasingHistoryCategory AS PurchasingHistoryCategory,
  HistoryBsc.GoodsMovementType AS GoodsMovementType,
  HistoryBsc.PostingDate AS PostingDate,
  HistoryBsc.Currency AS Currency,
  HistoryBsc.DebitCreditCode AS DebitCreditCode,
  HistoryBsc.IsCompletelyDelivered AS IsCompletelyDelivered,
  HistoryBsc.ReferenceDocumentFiscalYear AS ReferenceDocumentFiscalYear,
  HistoryBsc.InvtryMgmtReferenceDocument AS ReferenceDocument,
  HistoryBsc.InvtryMgmtRefDocumentItem AS ReferenceDocumentItem,
  HistoryBsc.Material AS Material,
  HistoryBsc.Plant AS Plant,
  HistoryBsc.RvslOfGoodsReceiptIsAllowed AS RvslOfGoodsReceiptIsAllowed,
  HistoryBsc.PricingDocument AS PricingDocument,
  HistoryBsc.TaxCode AS TaxCode,
  HistoryBsc.DocumentDate AS DocumentDate,
  HistoryBsc.CreatedByUser AS CreatedByUser,
  HistoryBsc.InventoryValuationType AS InventoryValuationType,
  HistoryBsc.DocumentReferenceID AS DocumentReferenceID,
  HistoryBsc.DeliveryQuantityUnit AS DeliveryQuantityUnit,
  HistoryBsc.ManufacturerMaterial AS ManufacturerMaterial,
  HistoryBsc.AccountingDocumentCreationDate AS AccountingDocumentCreationDate,
  HistoryBsc.PurgHistDocumentCreationTime AS PurgHistDocumentCreationTime,
  HistoryBsc.Quantity AS Quantity,
  HistoryBsc.PurOrdAmountInCompanyCodeCrcy AS PurOrdAmountInCompanyCodeCrcy,
  HistoryBsc.PurchaseOrderAmount AS PurchaseOrderAmount,
  HistoryBsc.QtyInPurchaseOrderPriceUnit AS QtyInPurchaseOrderPriceUnit,
  HistoryBsc.GRIRAcctClrgAmtInCoCodeCrcy AS GRIRAcctClrgAmtInCoCodeCrcy,
  HistoryBsc.GdsRcptBlkdStkQtyInOrdQtyUnit AS GdsRcptBlkdStkQtyInOrdQtyUnit,
  HistoryBsc.GdsRcptBlkdStkQtyInOrdPrcUnit AS GdsRcptBlkdStkQtyInOrdPrcUnit,
  HistoryBsc.InvoiceAmtInCoCodeCrcy AS InvoiceAmtInCoCodeCrcy,
  HistoryBsc.ShipgInstrnSupplierCompliance AS ShipgInstrnSupplierCompliance,
  HistoryBsc.InvoiceAmountInFrgnCurrency AS InvoiceAmountInFrgnCurrency,
  HistoryBsc.QuantityInDeliveryQtyUnit AS QuantityInDeliveryQtyUnit,
  HistoryBsc.GRIRAcctClrgAmtInTransacCrcy AS GRIRAcctClrgAmtInTransacCrcy,
  HistoryBsc.QuantityInBaseUnit AS QuantityInBaseUnit,
  HistoryBsc.Batch AS Batch,
  HistoryBsc.GRIRAcctClrgAmtInOrdTrnsacCrcy AS GRIRAcctClrgAmtInOrdTrnsacCrcy,
  HistoryBsc.InvoiceAmtInPurOrdTransacCrcy AS InvoiceAmtInPurOrdTransacCrcy,
  HistoryBsc.VltdGdsRcptBlkdStkQtyInOrdUnit AS VltdGdsRcptBlkdStkQtyInOrdUnit,
  HistoryBsc.VltdGdsRcptBlkdQtyInOrdPrcUnit AS VltdGdsRcptBlkdQtyInOrdPrcUnit,
  HistoryBsc.IsToBeAcceptedAtOrigin AS IsToBeAcceptedAtOrigin,
  HistoryBsc.ExchangeRateDifferenceAmount AS ExchangeRateDifferenceAmount,
  HistoryBsc.ExchangeRate AS ExchangeRate,
  HistoryBsc.DeliveryDocument AS DeliveryDocument,
  HistoryBsc.DeliveryDocumentItem AS DeliveryDocumentItem,
  OrderPriceUnit,
  OrderQuantityUnit,
  BaseUnit,
  PurchasingDocumentCurrency AS DocumentCurrency,
  CompanyCodeCurrency
FROM I_PurchasingDocumentHistoryBsc AS HistoryBsc
LEFT OUTER JOIN I_PurchasingDocument AS _PurchasingDocument ON PurchasingDocument = _PurchasingDocument.PurchasingDocument  -- association [1..1]
LEFT OUTER JOIN I_PurchasingDocumentItem AS _PurchasingDocumentItem ON PurchasingDocument = _PurchasingDocumentItem.PurchasingDocument AND PurchasingDocumentItem = _PurchasingDocumentItem.PurchasingDocumentItem  -- association [1..1]
-- UNION ALL with additional select branch(es): I_PurgDocRemovedHistory
;