C_PurgSpendOffContract2
Off Contract Spend Cube
C_PurgSpendOffContract2 is a Consumption CDS View (Cube) that provides data about "Off Contract Spend Cube" in SAP S/4HANA. It reads from 1 data source (P_PurOrdItmAcctAssgmt) and exposes 46 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber, PurgDocMigrtnIsCmpltdForAnlyts. It has 15 associations to related views.
SAP Help Documentation
| Category | CDS Views for Analytics |
|---|---|
| Data Category | Cube |
Purpose
This CDS view displays a list of purchase orders that have been purchased outside existing contracts, based on these parameters: currency, start date, and end date. This CDS view provides the data to answer the following business questions: Is migration of the purchasing document complete? What is the spend amount with contract reference, for the selected display currency? What is the spend amount without contract reference, for the selected display currency? To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views .
Prerequisites
Authorizations Users who want to use this CDS view must have one of the following business catalogs assigned: <Name of Business Catalog> Users who want to use this CDS view must have a role with the following restriction types set to read access: <Name of restriction type> These restriction types are edited in the Maintain Business Roles app.
Structure
Parameters The parameters of the CDS view are as follows: P_DISPLAYCURRENCY : This parameter is used to select the display currency, based on which the results are displayed. P_STARTDATE : This parameter is used to select a start date, only purchase orders created after this date are displayed. P_ENDDATE : This parameter is used to select an end date, only purchase orders created before this date are displayed.
Constraints
This analytical query view shall be interpreted and executed by the analytical infrastructure only. It is not intended to be used outside of this context. For example, it shall not be used in ABAP code for selecting data from it.
This CDS view displays a list of purchase orders that have been purchased outside existing contracts, based on these parameters: currency, start date, and end date. This CDS view provides the data to answer the following business questions: Is migration of the purchasing document complete? What is the spend amount with contract reference, for the selected display currency? What is the spend amount without contract reference, for the selected display currency? To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views .
Prerequisites
Authorizations Users who want to use this CDS view must have one of the following business catalogs assigned: <Name of Business Catalog> Users who want to use this CDS view must have a role with the following restriction types set to read access: <Name of restriction type> These restriction types are edited in the Maintain Business Roles app.
Structure
Parameters The parameters of the CDS view are as follows: P_DISPLAYCURRENCY : This parameter is used to select the display currency, based on which the results are displayed. P_STARTDATE : This parameter is used to select a start date, only purchase orders created after this date are displayed. P_ENDDATE : This parameter is used to select an end date, only purchase orders created before this date are displayed.
Constraints
This analytical query view shall be interpreted and executed by the analytical infrastructure only. It is not intended to be used outside of this context. For example, it shall not be used in ABAP code for selecting data from it.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_PurOrdItmAcctAssgmt | P_PurOrdItmAcctAssgmt | from |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_StartDate | bedat | |
| P_EndDate | bedat |
Associations (15)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | P_UNSGNDMATGRPTXT | _Doc | _Doc.DocNumber = '1' |
| [1..1] | I_PurchasingOrganization | _PurchasingOrganization | $projection.PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization |
| [1..1] | I_PurchasingGroup | _PurchasingGroup | $projection.PurchasingGroup = _PurchasingGroup.PurchasingGroup |
| [1..1] | I_Plant | _Plant | $projection.Plant = _Plant.Plant |
| [1..1] | I_PurchasingCategoryMatlGroup | _PurchasingCategoryMatlGroup | P_PurOrdItmAcctAssgmt.MaterialGroup = _PurchasingCategoryMatlGroup.MaterialGroup |
| [1..1] | I_CalendarDate | _CalendarDate | $projection.PurchaseOrderDate = _CalendarDate.CalendarDate |
| [1..1] | I_CompanyCode | _CompanyCode | $projection.CompanyCode = _CompanyCode.CompanyCode |
| [1..1] | I_CompanyCode | _HdrCompanyCode | $projection.PurgDocHdrCompanyCode = _HdrCompanyCode.CompanyCode |
| [1..1] | I_MaterialGroup | _MaterialGroup | $projection.MaterialGroup = _MaterialGroup.MaterialGroup |
| [1..1] | I_Material | _Material | $projection.Material = _Material.Material |
| [1..1] | I_Supplier | _Supplier | $projection.Supplier = _Supplier.Supplier |
| [1..1] | I_Country | _Country | $projection.SupplierCountry = _Country.Country |
| [1..1] | I_PurgDocumentItemCategory | _PurgDocumentItemCategory | $projection.PurchaseOrderItemCategory = _PurgDocumentItemCategory.PurchasingDocumentItemCategory |
| [1..1] | I_PurchasingDocumentType | _PurchasingDocumentType | $projection.PurchaseOrderType = _PurchasingDocumentType.PurchasingDocumentType and $projection.PurchaseOrderCategory = _PurchasingDocumentType.PurchasingDocumentCategory |
| [1..1] | I_PurchasingDocumentCategory | _PurchaseOrderCategory | $projection.PurchaseOrderCategory = _PurchaseOrderCategory.PurchasingDocumentCategory |
Annotations (13)
| Name | Value | Level | Field |
|---|---|---|---|
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| AbapCatalog.sqlViewName | CMMSPNDCNTRT2 | view | |
| EndUserText.label | Off Contract Spend Cube | view | |
| VDM.viewType | #CONSUMPTION | view | |
| Analytics.dataCategory | #CUBE | view | |
| Metadata.allowExtensions | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.modelingPattern | #ANALYTICAL_CUBE | view |
Fields (46)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | Purchasing Document | ||
| KEY | PurchaseOrderItem | PurchaseOrderItem | Purchasing Document Item | |
| KEY | AccountAssignmentNumber | AccountAssignmentNumber | Account Assgmt No. | |
| KEY | PurgDocMigrtnIsCmpltdForAnlyts | PurgDocMigrtnIsCmpltdForAnlyts | ||
| CalendarYear | _CalendarDate | CalendarYear | Year | |
| CalendarMonth | _CalendarDate | CalendarMonth | Calendar Month | |
| CalendarQuarter | _CalendarDate | CalendarQuarter | Calendar Quarter | |
| CalendarWeek | _CalendarDate | CalendarWeek | Calendar Week | |
| YearWeek | _CalendarDate | YearWeek | Year and Calendar Week | |
| YearMonth | _CalendarDate | YearMonth | Year Month | |
| YearQuarter | _CalendarDate | YearQuarter | Year Quarter | |
| PurchaseOrderDate | PurchaseOrderDate | PO Date | ||
| PurchaseOrderCategory | PurchaseOrderCategory | Doc. Category | ||
| PurchaseOrderType | PurchaseOrderType | PO Type | ||
| PurchaseOrderItemCategory | PurchaseOrderItemCategory | Item Category | ||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| PurchasingGroup | PurchasingGroup | Purchasing Group | ||
| CompanyCode | P_PurOrdItmAcctAssgmt | CompanyCode | Receiver Company Code | |
| PurgDocHdrCompanyCode | PurgDocHdrCompanyCode | |||
| Supplier | Supplier | Supplier | ||
| SupplierCountry | ||||
| Material | Material | Vehicle Model | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| Plant | P_PurOrdItmAcctAssgmt | Plant | Valuation Area | |
| PurchasingCategory | ||||
| PurchaseOutlineAgreement | PurchaseContract | Purchasing Doc. | ||
| PurchaseOutlineAgreementItem | PurchaseContractItem | Item | ||
| Currency | Currency | Valuation Crcy | ||
| CreatedByUser | CreatedByUser | User Name | ||
| CostCenter | CostCenter | Cost Center | ||
| WBSElementInternalID | WBSElementInternalID | WBS Internal ID | ||
| PurgCatNameendasPurgCatName | ||||
| DisplayCurrency | Display Currency | |||
| PurchaseOrderAmount | ||||
| _PurchasingDocumentType | _PurchasingDocumentType | |||
| _PurgDocumentItemCategory | _PurgDocumentItemCategory | |||
| _MaterialGroup | _MaterialGroup | |||
| _Material | _Material | |||
| _PurchasingOrganization | _PurchasingOrganization | |||
| _PurchasingGroup | _PurchasingGroup | |||
| _Plant | _Plant | |||
| _PurchaseOrderCategory | _PurchaseOrderCategory | |||
| _CompanyCode | _CompanyCode | |||
| _HdrCompanyCode | _HdrCompanyCode | |||
| _Supplier | _Supplier | |||
| _Country | _Country |
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 C_PurgSpendOffContract2.
-- 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: CMMSPNDCNTRT2
-- Parameters: P_DisplayCurrency : displaycurrency, P_StartDate : bedat, P_EndDate : bedat
CREATE VIEW C_PurgSpendOffContract2 AS
SELECT
cast( PurchaseOrder as vdm_purchaseorder ) AS PurchaseOrder,
PurchaseOrderItem,
AccountAssignmentNumber,
PurgDocMigrtnIsCmpltdForAnlyts,
_CalendarDate.CalendarYear AS CalendarYear,
_CalendarDate.CalendarMonth AS CalendarMonth,
_CalendarDate.CalendarQuarter AS CalendarQuarter,
_CalendarDate.CalendarWeek AS CalendarWeek,
_CalendarDate.YearWeek AS YearWeek,
_CalendarDate.YearMonth AS YearMonth,
_CalendarDate.YearQuarter AS YearQuarter,
PurchaseOrderDate,
PurchaseOrderCategory,
PurchaseOrderType,
PurchaseOrderItemCategory,
PurchasingOrganization,
PurchasingGroup,
P_PurOrdItmAcctAssgmt.CompanyCode AS CompanyCode,
PurgDocHdrCompanyCode,
Supplier,
cast( _Supplier.Country as mm_a_supplier_country ) AS SupplierCountry,
Material,
MaterialGroup,
P_PurOrdItmAcctAssgmt.Plant AS Plant,
_PurchasingCategoryMatlGroup._PurchasingCategory.PurchasingCategory AS PurchasingCategory,
PurchaseContract AS PurchaseOutlineAgreement,
PurchaseContractItem AS PurchaseOutlineAgreementItem,
Currency,
CreatedByUser,
CostCenter,
WBSElementInternalID,
case when _PurchasingCategoryMatlGroup._PurchasingCategory.PurgCatName is null then _Doc.DomainText else _PurchasingCategoryMatlGroup._PurchasingCategory.PurgCatName end as PurgCatName AS PurgCatNameendasPurgCatName,
cast( DisplayCurrency as displaycurrency) AS DisplayCurrency,
cast( PurOrdNetAmountInDisplayCrcy as purchase_order_net_amount ) AS PurchaseOrderAmount
FROM P_PurOrdItmAcctAssgmt
LEFT OUTER JOIN P_UNSGNDMATGRPTXT AS _Doc ON _Doc.DocNumber = '1' -- association [1..1]
LEFT OUTER JOIN I_PurchasingOrganization AS _PurchasingOrganization ON PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization -- association [1..1]
LEFT OUTER JOIN I_PurchasingGroup AS _PurchasingGroup ON PurchasingGroup = _PurchasingGroup.PurchasingGroup -- association [1..1]
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant -- association [1..1]
LEFT OUTER JOIN I_PurchasingCategoryMatlGroup AS _PurchasingCategoryMatlGroup ON P_PurOrdItmAcctAssgmt.MaterialGroup = _PurchasingCategoryMatlGroup.MaterialGroup -- association [1..1]
LEFT OUTER JOIN I_CalendarDate AS _CalendarDate ON PurchaseOrderDate = _CalendarDate.CalendarDate -- association [1..1]
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode -- association [1..1]
LEFT OUTER JOIN I_CompanyCode AS _HdrCompanyCode ON PurgDocHdrCompanyCode = _HdrCompanyCode.CompanyCode -- association [1..1]
LEFT OUTER JOIN I_MaterialGroup AS _MaterialGroup ON MaterialGroup = _MaterialGroup.MaterialGroup -- association [1..1]
LEFT OUTER JOIN I_Material AS _Material ON Material = _Material.Material -- association [1..1]
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier -- association [1..1]
LEFT OUTER JOIN I_Country AS _Country ON SupplierCountry = _Country.Country -- association [1..1]
LEFT OUTER JOIN I_PurgDocumentItemCategory AS _PurgDocumentItemCategory ON PurchaseOrderItemCategory = _PurgDocumentItemCategory.PurchasingDocumentItemCategory -- association [1..1]
LEFT OUTER JOIN I_PurchasingDocumentType AS _PurchasingDocumentType ON PurchaseOrderType = _PurchasingDocumentType.PurchasingDocumentType AND PurchaseOrderCategory = _PurchasingDocumentType.PurchasingDocumentCategory -- association [1..1]
LEFT OUTER JOIN I_PurchasingDocumentCategory AS _PurchaseOrderCategory ON PurchaseOrderCategory = _PurchaseOrderCategory.PurchasingDocumentCategory -- association [1..1]
;
Learn More
- 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
- S/4HANA CDS View Deprecation: What You Need to Know
- 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