P_PurchaseOrderHistory_Basic

DDL: P_PURCHASEORDERHISTORY_BASIC SQL: PPOHISTB Type: view BASIC

P_PurchaseOrderHistory_Basic is a Basic CDS View in SAP S/4HANA. It reads from 2 data sources (I_PurchaseOrder, ekbe) and exposes 46 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber, PurchaseOrderTransactionType, MaterialDocumentYear. It has 3 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_PurchaseOrder _PurchaseOrder inner
ekbe ekbe from

Associations (3)

CardinalityTargetAliasCondition
[1..1] I_PurchaseOrderHistCategory _PurchaseOrderHistCategory $projection.PurchaseOrderHistCategory = _PurchaseOrderHistCategory.PurchaseOrderHistCategory
[1..1] I_PurchaseOrderItem _PurchaseOrderItem $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder and $projection.PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem
[1..1] I_UserContactCard _UserContactCard $projection.CreatedByUser = _UserContactCard.ContactCardID

Annotations (10)

NameValueLevelField
VDM.viewType #BASIC view
VDM.private true view
AbapCatalog.sqlViewName PPOHISTB view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view

Fields (46)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder
KEY PurchaseOrderItem
KEY AccountAssignmentNumber ekbe zekkn Account Assgmt No.
KEY PurchaseOrderTransactionType ekbe vgabe Transact. Type
KEY MaterialDocumentYear ekbe gjahr Settlement Year
KEY MaterialDocument ekbe belnr SD Document
KEY MaterialDocumentItem ekbe buzei Posting View Item
PurchaseOrderHistCategory ekbe bewtp PO History Cat.
SubsequentDebitCreditIsAllowed _PurchaseOrderHistCategory SubsequentDebitCreditIsAllowed
GoodsMovementType ekbe bwart Valuation Type
PostingDate ekbe budat Posting Date
Currency ekbe waers Transaction Currency
DebitCreditCode ekbe shkzg Returns
IsCompletelyDelivered ekbe elikz Delivery Completion
ReferenceDocumentFiscalYear ekbe lfgja Year Cur.Period
ReferenceDocument ekbe lfbnr Reference Doc.
ReferenceDocumentItem ekbe lfpos Ref. Doc. Item
Material ekbe matnr Vehicle Model
Plant ekbe werks Receiving Plant
DocumentDate ekbe bldat Journal Entry Date
CreatedByUser ekbe ernam User Name
InventoryValuationType ekbe bwtar Valuation Type
DocumentReferenceID ekbe xblnr Reference
DeliveryQuantityUnit ekbe lsmeh Del. Note Unit
AccountingDocumentCreationDate ekbe cpudt Imported On
Quantity ekbe menge WarrCountValue
PurOrdAmountInCompanyCodeCrcy ekbe dmbtr Loc. amount
PurchaseOrderAmount ekbe wrbtr Gross Amount
QtyInPurchaseOrderPriceUnit ekbe bpmng Qty. in OPUn
GRIRAcctClrgAmtInCoCodeCrcy ekbe arewr Ord.GRIR.Val
GdsRcptBlkdStkQtyInOrdQtyUnit ekbe wesbs GR Bl.St. OUn
GdsRcptBlkdStkQtyInOrdPrcUnit ekbe bpwes GR blocked stck
InvoiceAmtInCoCodeCrcy ekbe reewr Ord.Set.Value
InvoiceAmountInFrgnCurrency ekbe refwr Inv.Value in FC
QuantityInDeliveryQtyUnit ekbe lsmng Del. Note Qty
GRIRAcctClrgAmtInTransacCrcy ekbe areww GR/IR clr.value
QuantityInBaseUnit ekbe bamng Quantity
GRIRAcctClrgAmtInOrdTrnsacCrcy ekbe arewb GR/IR clr.value
InvoiceAmtInPurOrdTransacCrcy ekbe rewrb FC invoice amnt
VltdGdsRcptBlkdStkQtyInOrdUnit ekbe wesbb Val. GR BlStock OUn
VltdGdsRcptBlkdQtyInOrdPrcUnit ekbe bpweb Val. GR BS OPUn
ExchangeRateDifferenceAmount ekbe kudif Exch.Rate Diff.
_PurchaseOrderItem _PurchaseOrderItem
_PurchaseOrderHistCategory _PurchaseOrderHistCategory
_UserContactCard _UserContactCard
AuthorizationGroup

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_PurchaseOrderHistory_Basic.
-- 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: PPOHISTB

CREATE VIEW P_PurchaseOrderHistory_Basic AS
SELECT
  cast( ekbe.ebeln as vdm_purchaseorder ) AS PurchaseOrder,
  cast( ekbe.ebelp as vdm_purchaseorderitem ) AS PurchaseOrderItem,
  ekbe.zekkn AS AccountAssignmentNumber,
  ekbe.vgabe AS PurchaseOrderTransactionType,
  ekbe.gjahr AS MaterialDocumentYear,
  ekbe.belnr AS MaterialDocument,
  ekbe.buzei AS MaterialDocumentItem,
  ekbe.bewtp AS PurchaseOrderHistCategory,
  _PurchaseOrderHistCategory.SubsequentDebitCreditIsAllowed AS SubsequentDebitCreditIsAllowed,
  ekbe.bwart AS GoodsMovementType,
  ekbe.budat AS PostingDate,
  ekbe.waers AS Currency,
  ekbe.shkzg AS DebitCreditCode,
  ekbe.elikz AS IsCompletelyDelivered,
  ekbe.lfgja AS ReferenceDocumentFiscalYear,
  ekbe.lfbnr AS ReferenceDocument,
  ekbe.lfpos AS ReferenceDocumentItem,
  ekbe.matnr AS Material,
  ekbe.werks AS Plant,
  ekbe.bldat AS DocumentDate,
  ekbe.ernam AS CreatedByUser,
  ekbe.bwtar AS InventoryValuationType,
  ekbe.xblnr AS DocumentReferenceID,
  ekbe.lsmeh AS DeliveryQuantityUnit,
  ekbe.cpudt AS AccountingDocumentCreationDate,
  ekbe.menge AS Quantity,
  ekbe.dmbtr AS PurOrdAmountInCompanyCodeCrcy,
  ekbe.wrbtr AS PurchaseOrderAmount,
  ekbe.bpmng AS QtyInPurchaseOrderPriceUnit,
  ekbe.arewr AS GRIRAcctClrgAmtInCoCodeCrcy,
  ekbe.wesbs AS GdsRcptBlkdStkQtyInOrdQtyUnit,
  ekbe.bpwes AS GdsRcptBlkdStkQtyInOrdPrcUnit,
  ekbe.reewr AS InvoiceAmtInCoCodeCrcy,
  ekbe.refwr AS InvoiceAmountInFrgnCurrency,
  ekbe.lsmng AS QuantityInDeliveryQtyUnit,
  ekbe.areww AS GRIRAcctClrgAmtInTransacCrcy,
  ekbe.bamng AS QuantityInBaseUnit,
  ekbe.arewb AS GRIRAcctClrgAmtInOrdTrnsacCrcy,
  ekbe.rewrb AS InvoiceAmtInPurOrdTransacCrcy,
  ekbe.wesbb AS VltdGdsRcptBlkdStkQtyInOrdUnit,
  ekbe.bpweb AS VltdGdsRcptBlkdQtyInOrdPrcUnit,
  ekbe.kudif AS ExchangeRateDifferenceAmount,
  _PurchaseOrder._Supplier.AuthorizationGroup AS AuthorizationGroup
FROM ekbe
INNER JOIN I_PurchaseOrder AS _PurchaseOrder ON /* join condition not captured in parsed metadata */
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]
LEFT OUTER JOIN I_UserContactCard AS _UserContactCard ON CreatedByUser = _UserContactCard.ContactCardID  -- association [1..1]
;