P_PurchaseOrderHistory_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)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchaseOrder | _PurchaseOrder | inner |
| ekbe | ekbe | from |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | |||
| KEY | PurchaseOrderItem | |||
| KEY | AccountAssignmentNumber | ekbe | zekkn | |
| KEY | PurchaseOrderTransactionType | ekbe | vgabe | |
| KEY | MaterialDocumentYear | ekbe | gjahr | |
| KEY | MaterialDocument | ekbe | belnr | |
| KEY | MaterialDocumentItem | ekbe | buzei | |
| PurchaseOrderHistCategory | ekbe | bewtp | ||
| SubsequentDebitCreditIsAllowed | _PurchaseOrderHistCategory | SubsequentDebitCreditIsAllowed | ||
| GoodsMovementType | ekbe | bwart | ||
| PostingDate | ekbe | budat | ||
| Currency | ekbe | waers | ||
| DebitCreditCode | ekbe | shkzg | ||
| IsCompletelyDelivered | ekbe | elikz | ||
| ReferenceDocumentFiscalYear | ekbe | lfgja | ||
| ReferenceDocument | ekbe | lfbnr | ||
| ReferenceDocumentItem | ekbe | lfpos | ||
| Material | ekbe | matnr | ||
| Plant | ekbe | werks | ||
| DocumentDate | ekbe | bldat | ||
| CreatedByUser | ekbe | ernam | ||
| InventoryValuationType | ekbe | bwtar | ||
| DocumentReferenceID | ekbe | xblnr | ||
| DeliveryQuantityUnit | ekbe | lsmeh | ||
| AccountingDocumentCreationDate | ekbe | cpudt | ||
| Quantity | ekbe | menge | ||
| PurOrdAmountInCompanyCodeCrcy | ekbe | dmbtr | ||
| PurchaseOrderAmount | ekbe | wrbtr | ||
| QtyInPurchaseOrderPriceUnit | ekbe | bpmng | ||
| GRIRAcctClrgAmtInCoCodeCrcy | ekbe | arewr | ||
| GdsRcptBlkdStkQtyInOrdQtyUnit | ekbe | wesbs | ||
| GdsRcptBlkdStkQtyInOrdPrcUnit | ekbe | bpwes | ||
| InvoiceAmtInCoCodeCrcy | ekbe | reewr | ||
| InvoiceAmountInFrgnCurrency | ekbe | refwr | ||
| QuantityInDeliveryQtyUnit | ekbe | lsmng | ||
| GRIRAcctClrgAmtInTransacCrcy | ekbe | areww | ||
| QuantityInBaseUnit | ekbe | bamng | ||
| GRIRAcctClrgAmtInOrdTrnsacCrcy | ekbe | arewb | ||
| InvoiceAmtInPurOrdTransacCrcy | ekbe | rewrb | ||
| VltdGdsRcptBlkdStkQtyInOrdUnit | ekbe | wesbb | ||
| VltdGdsRcptBlkdQtyInOrdPrcUnit | ekbe | bpweb | ||
| ExchangeRateDifferenceAmount | ekbe | kudif | ||
| _PurchaseOrderItem | _PurchaseOrderItem | |||
| _PurchaseOrderHistCategory | _PurchaseOrderHistCategory | |||
| _UserContactCard | _UserContactCard | |||
| AuthorizationGroup |
@VDM.viewType: #BASIC
@VDM.private: true
@AbapCatalog.sqlViewName: 'PPOHISTB'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.privilegedAssociations: [ '_UserContactCard']
@AccessControl.personalData.blocking: #REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
define view P_PurchaseOrderHistory_Basic
as select from ekbe as ekbe
inner join I_PurchaseOrder as _PurchaseOrder on ekbe.ebeln = _PurchaseOrder.PurchaseOrder
association [1..1] to I_PurchaseOrderHistCategory as _PurchaseOrderHistCategory on $projection.PurchaseOrderHistCategory = _PurchaseOrderHistCategory.PurchaseOrderHistCategory
association [1..1] to I_PurchaseOrderItem as _PurchaseOrderItem on $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder
and $projection.PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem
association [1..1] to I_UserContactCard as _UserContactCard on $projection.CreatedByUser = _UserContactCard.ContactCardID
{
key cast( ekbe.ebeln as vdm_purchaseorder ) as PurchaseOrder,
key cast( ekbe.ebelp as vdm_purchaseorderitem ) as PurchaseOrderItem,
key ekbe.zekkn as AccountAssignmentNumber,
key ekbe.vgabe as PurchaseOrderTransactionType,
key ekbe.gjahr as MaterialDocumentYear,
key ekbe.belnr as MaterialDocument,
key 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,
_PurchaseOrderItem,
_PurchaseOrderHistCategory,
_UserContactCard,
@Consumption.hidden: true
_PurchaseOrder._Supplier.AuthorizationGroup //GDPR Supplier Authorization
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PURCHASEORDER",
"I_PURCHASEORDERHISTCATEGORY",
"I_SUPPLIER",
"EKBE"
],
"ASSOCIATED":
[
"I_PURCHASEORDERHISTCATEGORY",
"I_PURCHASEORDERITEM",
"I_USERCONTACTCARD"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- 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