C_PurchaseOrderValue
Purchase Order Value
C_PurchaseOrderValue is a Consumption CDS View (Cube) that provides data about "Purchase Order Value" in SAP S/4HANA. It reads from 3 data sources (P_UNSGNDMATGRPTXT, P_PURCHASEORDERVALUE, I_PurchasingCategoryMatlGroup) and exposes 61 fields with key fields PurchaseOrderItem, AccountAssignmentNumber, PurgDocMigrtnIsCmpltdForAnlyts. It has 11 associations to related views. It is used in 3 Fiori applications: Spend Variance, Purchase Order Value and Scheduling Agreement Value, Purchase Order Average Delivery Time. Part of development package ODATA_MM_ANALYTICS.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| P_UNSGNDMATGRPTXT | _Doc | left_outer |
| P_PURCHASEORDERVALUE | P_PURCHASEORDERVALUE | from |
| I_PurchasingCategoryMatlGroup | PurchasingCategoryMatlGroup | left_outer |
Parameters (5)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_DateFunction | datefunctionid | |
| P_StartDate | bedat | |
| P_EndDate | bedat | |
| P_Language | sylangu |
Associations (11)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | P_Purordmaintaincustproj | _WBSElement | $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID |
| [1..1] | I_Product | _MaterialText | $projection.Material = _MaterialText.Product |
| [1..1] | I_ProductGroup | _MaterialGroupText | $projection.MaterialGroup = _MaterialGroupText.MaterialGroup |
| [1..1] | I_CalendarDate | _CalendarDate | $projection.PurchaseOrderDate = _CalendarDate.CalendarDate |
| [0..1] | I_WBSElementByInternalKey | _WBSElementByInternal | $projection.WBSElementInternalID = _WBSElementByInternal.WBSElementInternalID |
| [1..1] | I_PurchasingGroup | _PurchasingGroup | $projection.PurchasingGroup = _PurchasingGroup.PurchasingGroup |
| [1..1] | I_PurchasingOrganization | _PurchasingOrganization | $projection.PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization |
| [1..1] | I_CalendarMonth | _CalendarMonth | _CalendarDate.CalendarMonth = _CalendarMonth.CalendarMonth |
| [1..1] | I_CalendarMonth | _CalendarMonthWithText | $projection.PostingMonth = _CalendarMonthWithText.CalendarMonth |
| [0..1] | I_CountryGeoPoint | _CountryGeoPoint | $projection.Country = _CountryGeoPoint.Country |
| [0..1] | I_Region | _SupplierRegion | $projection.region = _SupplierRegion.Region and $projection.SupplierCountry = _SupplierRegion.Country |
Annotations (14)
| Name | Value | Level | Field |
|---|---|---|---|
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| EndUserText.label | Purchase Order Value | view | |
| VDM.viewType | #CONSUMPTION | view | |
| Analytics.dataCategory | #CUBE | view | |
| AbapCatalog.sqlViewName | CMMPURORDVALUE | view | |
| OData.publish | true | view | |
| Metadata.allowExtensions | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.modelingPattern | #ANALYTICAL_CUBE | view |
Fiori Apps (3)
| App ID | App Name | Type | Description |
|---|---|---|---|
| F1377 | Spend Variance | Analytical | You can use this app to determine the sum of the purchase order value, goods receipt value, and invoice value per supplier or material. It then calculates the relation between the purchase orders, good receipts, and invoice value for a given filter. |
| F1378 | Purchase Order Value and Scheduling Agreement Value | Analytical | You can use this app to retrieve the order value for all the purchase orders over time. The app also helps to determine the KPI value of the purchase orders for a given set of filter criteria such as the materials, supplier, and plant. The business value of the app is that you can determine all the current value of all purchase orders in the system. |
| F1380 | Purchase Order Average Delivery Time | Analytical | You can use this app to check the average delivery time of orders to the suppliers. |
Spend Variance
Business Role: Strategic Buyer
With the Spend Variance app, you can determine the sum of the purchase order value, goods receipt value, and invoice value per supplier or material. It then calculates the relation between the purchase orders, good receipts, and invoice value for a given filter. The role Strategic Buyer (SAP_BR_BUYER) is required to access the app. The KPI is displayed in the following views: •By Supplier•By Purchasing Category•By Material Group•Plant•By Purchasing Group•By Material•Document
Purchase Order Value and Scheduling Agreement Value
Business Role: Strategic Buyer
You can use this app to retrieve the order value for all the purchase orders within a stipulated time. The app also helps to determine the KPI value of the purchase orders for a given set of filter criteria such as the materials, supplier, and plant. The business value of the app is that you can determine all the current value of all purchase orders in the system. The role Strategic Buyer (SAP_BR_BUYER) is required to access the app. This KPI is displayed in the following views: •By Supplier•By Purchasing Category•By Material Group•By Purchasing Group•By Plant•By WBS Element•Document•Trend
Purchase Order Average Delivery Time
Business Role: Strategic Buyer
Using the Purchase Order Average Delivery Time Weighted app, you can check the average delivery time of orders to the suppliers. The role Strategic Buyer (SAP_BR_BUYER) is required to access the app. The app is displayed in the following views: •By Supplier•By Material Group•By Plant•By Purchasing Category•Document
Fields (61)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| resultElementDateFunctionStartDate | ||||
| resultElementDateFunctionEndDate | ||||
| P_DisplayCurrency | ||||
| P_StartDate | ||||
| KEY | PurchaseOrderItem | |||
| KEY | AccountAssignmentNumber | AccountAssignmentNumber | ||
| KEY | PurgDocMigrtnIsCmpltdForAnlyts | PurgDocMigrtnIsCmpltdForAnlyts | ||
| PurgCatUUID | PurgCatUUID | |||
| Supplier | Supplier | |||
| SupplierName | _Supplier | SupplierName | ||
| SupplierCountry | SupplierCountry | |||
| CountryName | ||||
| Country | SupplierCountry | |||
| Region | _Supplier | Region | ||
| PurchaseOrderDate | PurchaseOrderDate | |||
| IsCompletelyDelivered | IsCompletelyDelivered | |||
| CalendarYear | _CalendarDate | CalendarYear | ||
| CalendarQuarter | _CalendarDate | CalendarQuarter | ||
| CalendarMonth | _CalendarDate | CalendarMonth | ||
| PostingMonth | _CalendarDate | CalendarMonth | ||
| CalendarWeek | _CalendarDate | CalendarWeek | ||
| YearQuarter | _CalendarDate | YearQuarter | ||
| PurchasingOrganization | PurchasingOrganization | |||
| PurchasingOrganizationName | _PurchasingOrganization | PurchasingOrganizationName | ||
| CompanyCode | CompanyCode | |||
| PurchasingGroup | PurchasingGroup | |||
| PurchasingGroupName | _PurchasingGroup | PurchasingGroupName | ||
| Material | Material | |||
| MaterialName | ||||
| MaterialGroup | P_PurOrdItmAcctAssgmt | MaterialGroup | ||
| MaterialGroupName | ||||
| Plant | Plant | |||
| PlantName | _Plant | PlantName | ||
| ProductTypeCode | ProductType | |||
| ProductType | ||||
| ServicePerformer | ServicePerformer | |||
| PurchasingCategory | Purchasing Category(Deprecated) | |||
| PurgCatRelatedToMaterialGroup | Purchasing Category | |||
| PurgCatNameendasPurgCatName | ||||
| WBSElementInternalID | WBSElementInternalID | |||
| CustomerProjectName | _WBSElement | CustomerProjectName | ||
| CustProjWorkPackageName | _WBSElement | CustProjWorkPackageName | ||
| WBSElement | _WBSElementByInternal | WBSElement | ||
| WBSDescription | _WBSElementByInternal | WBSDescription | ||
| CostCenter | CostCenter | |||
| DisplayCurrency | ||||
| PurOrdNetAmountInDisplayCrcy | PurOrdNetAmountInDisplayCrcy | |||
| NumberOfPurchaseOrders | ||||
| NmbrOfCmpltlyDlvrdPurOrdItms | ||||
| NumberOfPurchaseOrderItems | ||||
| _MaterialGroupText | _MaterialGroupText | |||
| _Plant | _Plant | |||
| _PurchasingGroup | _PurchasingGroup | |||
| _PurchasingOrganization | _PurchasingOrganization | |||
| _Supplier | _Supplier | |||
| _SupplierCountry | _SupplierCountry | |||
| _MaterialText | _MaterialText | |||
| _CalendarMonthWithText | _CalendarMonthWithText | |||
| _CalendarMonth | _CalendarMonth | |||
| _CountryGeoPoint | _CountryGeoPoint | |||
| _SupplierRegion | _SupplierRegion |
@ClientHandling.algorithm: #SESSION_VARIABLE //Inserted by VDM CDS Suite Plugin
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #L
@EndUserText.label: 'Purchase Order Value'
@VDM.viewType: #CONSUMPTION
@Analytics.dataCategory: #CUBE
@AbapCatalog.sqlViewName: 'CMMPURORDVALUE'
@OData.publish: true
@Metadata.allowExtensions:true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.supportedCapabilities: [ #ANALYTICAL_PROVIDER ]
@ObjectModel.modelingPattern: #ANALYTICAL_CUBE
define view C_PurchaseOrderValue
with parameters
P_DisplayCurrency : displaycurrency,
P_DateFunction : datefunctionid,
@Consumption.derivation: { lookupEntity: 'C_SglGregorianCalDateFunction',
resultElement: 'DateFunctionStartDate', binding: [ {
targetParameter: 'P_DateFunction', type: #PARAMETER, value : 'P_DateFunction' },
{ targetParameter : 'P_Language' , type : #SYSTEM_FIELD, value : '#SYSTEM_LANGUAGE' } ]
}
@Consumption.hidden: true
P_StartDate : bedat,
@Consumption.derivation: { lookupEntity: 'C_SglGregorianCalDateFunction',
resultElement: 'DateFunctionEndDate', binding: [ {
targetParameter: 'P_DateFunction', type: #PARAMETER, value : 'P_DateFunction' },
{ targetParameter : 'P_Language' , type : #SYSTEM_FIELD, value : '#SYSTEM_LANGUAGE' } ]
}
@Consumption.hidden: true
P_EndDate : bedat,
@Consumption.hidden : true
@Environment.systemField : #SYSTEM_LANGUAGE
P_Language : sylangu
as select from P_PURCHASEORDERVALUE( P_DisplayCurrency: $parameters.P_DisplayCurrency,
P_StartDate : $parameters.P_StartDate,
P_EndDate : $parameters.P_EndDate ) as P_PurOrdItmAcctAssgmt
// inner join P_RelevantDates( P_Date: $parameters.P_Date,
// P_EvaluationTimeFrameInDays: $parameters.P_EvaluationTimeFrameInDays) as _Date on PurchaseOrderDate = _Date.CalendarDate
left outer join I_PurchasingCategoryMatlGroup as PurchasingCategoryMatlGroup on P_PurOrdItmAcctAssgmt.MaterialGroup = PurchasingCategoryMatlGroup.MaterialGroup
left outer join P_UNSGNDMATGRPTXT as _Doc on _Doc.DocNumber = '1'
association [1..1] to P_Purordmaintaincustproj as _WBSElement on $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
association [1..1] to I_Product as _MaterialText on $projection.Material = _MaterialText.Product
association [1..1] to I_ProductGroup as _MaterialGroupText on $projection.MaterialGroup = _MaterialGroupText.MaterialGroup
association [1..1] to I_CalendarDate as _CalendarDate on $projection.PurchaseOrderDate = _CalendarDate.CalendarDate
association [0..1] to I_WBSElementByInternalKey as _WBSElementByInternal on $projection.WBSElementInternalID = _WBSElementByInternal.WBSElementInternalID
association [1..1] to I_PurchasingGroup as _PurchasingGroup on $projection.PurchasingGroup = _PurchasingGroup.PurchasingGroup
association [1..1] to I_PurchasingOrganization as _PurchasingOrganization on $projection.PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization
association [1..1] to I_CalendarMonth as _CalendarMonth on _CalendarDate.CalendarMonth = _CalendarMonth.CalendarMonth
association [1..1] to I_CalendarMonth as _CalendarMonthWithText on $projection.PostingMonth = _CalendarMonthWithText.CalendarMonth
association [0..1] to I_CountryGeoPoint as _CountryGeoPoint on $projection.Country = _CountryGeoPoint.Country
association [0..1] to I_Region as _SupplierRegion on $projection.region = _SupplierRegion.Region
and $projection.SupplierCountry = _SupplierRegion.Country
{
/* Keys */
key cast(P_PurOrdItmAcctAssgmt.PurchaseOrder as vdm_purchaseorder) as PurchaseOrder,
key cast(PurchaseOrderItem as vdm_purchaseorderitem) as PurchaseOrderItem,
key AccountAssignmentNumber,
@Environment.sql.passValue: true
key PurgDocMigrtnIsCmpltdForAnlyts,
@Consumption.hidden: true
PurgCatUUID,
/* Supplier */
@ObjectModel.foreignKey.association: '_Supplier'
Supplier,
@Semantics.text: true
_Supplier.SupplierName,
@ObjectModel.foreignKey.association: '_SupplierCountry'
SupplierCountry,
@Semantics.text: true
_SupplierCountry._Text[1: Language = $parameters.P_Language].CountryName,
@ObjectModel.foreignKey.association: '_CountryGeoPoint'
SupplierCountry as Country,
@ObjectModel.foreignKey.association: '_SupplierRegion'
_Supplier.Region,
/* Order Date */
//@Consumption.hidden: true Commented because of BOC stories
PurchaseOrderDate,
IsCompletelyDelivered,
@Semantics.calendar.year: true
_CalendarDate.CalendarYear,
_CalendarDate.CalendarQuarter,
@VDM.lifecycle.status:#DEPRECATED
@VDM.lifecycle.successor: 'PostingMonth'
_CalendarDate.CalendarMonth,
@ObjectModel.foreignKey.association: '_CalendarMonthWithText'
_CalendarDate.CalendarMonth as PostingMonth,
_CalendarDate.CalendarWeek,
@Consumption.hidden: true
_CalendarDate.YearQuarter,
/* Header */
@ObjectModel.foreignKey.association: '_PurchasingOrganization'
PurchasingOrganization,
@Semantics.text: true
_PurchasingOrganization.PurchasingOrganizationName,
CompanyCode,
@ObjectModel.foreignKey.association: '_PurchasingGroup'
PurchasingGroup,
@Semantics.text: true
_PurchasingGroup.PurchasingGroupName,
/* Item Data */
@ObjectModel.foreignKey.association: '_MaterialText'
Material,
@Semantics.text: true
_MaterialText._Text[1: Language = $session.system_language].ProductName as MaterialName,
@ObjectModel.foreignKey.association: '_MaterialGroupText'
P_PurOrdItmAcctAssgmt.MaterialGroup,
@Semantics.text: true
_MaterialGroupText._Text[1: Language = $session.system_language].MaterialGroupName as MaterialGroupName,
@ObjectModel.foreignKey.association: '_Plant'
Plant,
@Semantics.text: true
_Plant.PlantName,
ProductType as ProductTypeCode,
@VDM.lifecycle.status:#DEPRECATED
@VDM.lifecycle.successor:'ProductTypeCode'
cast ( ProductType as producttype) as ProductType,
ServicePerformer,
@VDM.lifecycle.status:#DEPRECATED
@VDM.lifecycle.successor: 'PurgCatRelatedToMaterialGroup'
@ObjectModel.text.element: ['PurgCatName']
@Consumption.labelElement: 'PurgCatName'
@EndUserText.label: 'Purchasing Category(Deprecated)'
PurchasingCategoryMatlGroup._PurchasingCategory.PurchasingCategory as PurchasingCategory,
@ObjectModel.text.element: ['PurgCatName']
@Consumption.labelElement: 'PurgCatName'
@EndUserText.label: 'Purchasing Category'
coalesce(PurchasingCategoryMatlGroup._PurchasingCategory.PurchasingCategory,'') as PurgCatRelatedToMaterialGroup,
case when PurchasingCategoryMatlGroup._PurchasingCategory.PurgCatName is null then
cast( _Doc.DomainText as /srmsmc/puc_name preserving type)
// 'Material Group not linked to purchasing category'
else PurchasingCategoryMatlGroup._PurchasingCategory.PurgCatName end as PurgCatName,
WBSElementInternalID,
@Consumption.hidden: true
_WBSElement.CustomerProjectName,
@Consumption.hidden: true
_WBSElement.CustProjWorkPackageName,
@ObjectModel.text.element: ['WBSDescription']
@Consumption.labelElement: 'WBSDescription'
_WBSElementByInternal.WBSElement,
@Semantics.text: true
_WBSElementByInternal.WBSDescription,
CostCenter,
@UI.hidden: true
@Semantics.currencyCode:true
cast( :P_DisplayCurrency as displaycurrency ) as DisplayCurrency,
/* Order Amount*/
@Semantics.amount.currencyCode: 'DisplayCurrency'
@DefaultAggregation:#SUM
PurOrdNetAmountInDisplayCrcy,
@Aggregation.referenceElement: ['PurchaseOrder']
@Aggregation.default: #COUNT_DISTINCT
cast( 1 as abap.int4 ) as NumberOfPurchaseOrders,
// new Field name Proposed : NmbrOfCmpltlyDlvrdPurOrdItms
// Deprecating the field 'NmbrOfCmpltlyDlvrdPurOrdItms' (Count of delivery completed PO Items) as this measure not achievable since the key definition of the CDS is not at Purchase Order Item.
// The key definition is at Account Assignment Number level. The successor field 'NumberOfPurchaseOrderItems' would show the count of Purchaser Order Items as a measure.
// JIRA reference - https://jira.tools.sap/browse/S4HPROCANALYTICS-1476
@Aggregation.referenceElement: ['PurchaseOrderItem']
@Aggregation.default: #COUNT_DISTINCT
@API.element.releaseState: #DEPRECATED
@API.element.successor: 'NumberOfPurchaseOrderItems'
cast( 1 as abap.int4 ) as NmbrOfCmpltlyDlvrdPurOrdItms,
@Aggregation.referenceElement: ['PurchaseOrderItem']
@Aggregation.default: #COUNT_DISTINCT
cast( 1 as abap.int4 ) as NumberOfPurchaseOrderItems,
_MaterialGroupText,
_Plant,
_PurchasingGroup,
_PurchasingOrganization,
_Supplier,
_SupplierCountry,
_MaterialText,
_CalendarMonthWithText,
@VDM.lifecycle.status:#DEPRECATED
@VDM.lifecycle.successor: '_CalendarMonthWithText'
_CalendarMonth,
_CountryGeoPoint,
_SupplierRegion
}
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