C_PurchaseOrderSpend
Purchase Order Spend
C_PurchaseOrderSpend is a Consumption CDS View (Cube) that provides data about "Purchase Order Spend" in SAP S/4HANA. It reads from 2 data sources (P_PurOrdItemAcctAssgmt, I_PurchasingCategoryMatlGroup) and exposes 34 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber. It has 4 associations to related views. Part of development package ODATA_MM_ANALYTICS.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| P_PurOrdItemAcctAssgmt | P_PurOrdItemAcctAssgmt | from |
| I_PurchasingCategoryMatlGroup | PurchasingCategoryMatlGroup | left_outer |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_StartDate | bedat | |
| P_EndDate | bedat |
Associations (4)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | P_Purordmaintaincustproj | _WBSElement | $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID |
| [1..1] | I_PurchasingOrganization | _PurchasingOrganization | $projection.PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization |
| [1..1] | I_MaterialGroup | _MaterialGroup | $projection.MaterialGroup = _MaterialGroup.MaterialGroup |
| [1..1] | I_PurchasingDocumentStatus | _PurchasingDocumentStatus | $projection.PurchasingDocumentStatus = _PurchasingDocumentStatus.PurchasingDocumentStatus |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| VDM.viewType | #CONSUMPTION | view | |
| Analytics.dataCategory | #CUBE | view | |
| Metadata.allowExtensions | true | view | |
| Analytics.technicalName | CMMPURORDSPND | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_EXCLUDED | view | |
| EndUserText.label | Purchase Order Spend | view | |
| ObjectModel.modelingPattern | #ANALYTICAL_CUBE | view |
Fields (34)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | PurchaseOrder | PurchaseOrder | Purchasing Document |
| KEY | PurchaseOrderItem | PurchaseOrder | PurchaseOrderItem | Purchasing Document Item |
| KEY | AccountAssignmentNumber | PurchaseOrder | AccountAssignmentNumber | Account Assgmt No. |
| PurgCatUUID | I_PurchasingCategoryMatlGroup | PurgCatUUID | ||
| Supplier | PurchaseOrder | Supplier | Supplier | |
| SupplierCountry | PurchaseOrder | SupplierCountry | ||
| PurchaseOrderDate | PurchaseOrder | PurchaseOrderDate | PO Date | |
| CalendarYear | PurchaseOrder | CalendarYear | Year | |
| CalendarQuarter | PurchaseOrder | CalendarQuarter | Calendar Quarter | |
| CalendarMonth | PurchaseOrder | CalendarMonth | Calendar Month | |
| CalendarWeek | PurchaseOrder | CalendarWeek | Calendar Week | |
| YearQuarter | PurchaseOrder | YearQuarter | Year Quarter | |
| PurchasingOrganization | PurchaseOrder | PurchasingOrganization | Purchasing Organization | |
| CompanyCode | PurchaseOrder | CompanyCode | Receiver Company Code | |
| PurchasingGroup | PurchaseOrder | PurchasingGroup | Purchasing Group | |
| PurchasingDocumentStatus | PurchaseOrder | PurchasingDocumentStatus | Short Description | |
| Material | PurchaseOrder | Material | Vehicle Model | |
| MaterialGroup | PurchaseOrder | MaterialGroup | Product Group | |
| Plant | PurchaseOrder | Plant | Valuation Area | |
| ProductTypeCode | PurchaseOrder | ProductType | Product Type Group | |
| ServicePerformer | PurchaseOrder | ServicePerformer | Service Performer | |
| PurchasingCategory | ||||
| PurgCatName | ||||
| WBSElementInternalID | PurchaseOrder | WBSElementInternalID | WBS Internal ID | |
| WBSElement | PurchaseOrder | WBSElement | WBS Internal ID | |
| WBSDescription | PurchaseOrder | WBSDescription | WBS Element Name | |
| CustomerProjectName | _WBSElement | CustomerProjectName | ||
| CustProjWorkPackageName | _WBSElement | CustProjWorkPackageName | ||
| CostCenter | PurchaseOrder | CostCenter | Cost Center | |
| DisplayCurrency | ||||
| PurOrdNetAmountInDisplayCrcy | ||||
| _PurchasingOrganization | _PurchasingOrganization | |||
| _PurchasingDocumentStatus | _PurchasingDocumentStatus | |||
| _MaterialGroup | _MaterialGroup |
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_PurchaseOrderSpend.
-- 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.
-- Parameters: P_DisplayCurrency : displaycurrency, P_StartDate : bedat, P_EndDate : bedat
CREATE VIEW C_PurchaseOrderSpend AS
SELECT
PurchaseOrder.PurchaseOrder AS PurchaseOrder,
PurchaseOrder.PurchaseOrderItem AS PurchaseOrderItem,
PurchaseOrder.AccountAssignmentNumber AS AccountAssignmentNumber,
PurchasingCategoryMatlGroup.PurgCatUUID AS PurgCatUUID,
PurchaseOrder.Supplier AS Supplier,
PurchaseOrder.SupplierCountry AS SupplierCountry,
PurchaseOrder.PurchaseOrderDate AS PurchaseOrderDate,
PurchaseOrder.CalendarYear AS CalendarYear,
PurchaseOrder.CalendarQuarter AS CalendarQuarter,
PurchaseOrder.CalendarMonth AS CalendarMonth,
PurchaseOrder.CalendarWeek AS CalendarWeek,
PurchaseOrder.YearQuarter AS YearQuarter,
PurchaseOrder.PurchasingOrganization AS PurchasingOrganization,
PurchaseOrder.CompanyCode AS CompanyCode,
PurchaseOrder.PurchasingGroup AS PurchasingGroup,
PurchaseOrder.PurchasingDocumentStatus AS PurchasingDocumentStatus,
PurchaseOrder.Material AS Material,
PurchaseOrder.MaterialGroup AS MaterialGroup,
PurchaseOrder.Plant AS Plant,
PurchaseOrder.ProductType AS ProductTypeCode,
PurchaseOrder.ServicePerformer AS ServicePerformer,
PurchasingCategoryMatlGroup._PurchasingCategory.PurchasingCategory AS PurchasingCategory,
PurchasingCategoryMatlGroup._PurchasingCategory.PurgCatName AS PurgCatName,
PurchaseOrder.WBSElementInternalID AS WBSElementInternalID,
PurchaseOrder.WBSElement AS WBSElement,
PurchaseOrder.WBSDescription AS WBSDescription,
_WBSElement.CustomerProjectName AS CustomerProjectName,
_WBSElement.CustProjWorkPackageName AS CustProjWorkPackageName,
PurchaseOrder.CostCenter AS CostCenter,
cast( $parameters.P_DisplayCurrency as displaycurrency ) AS DisplayCurrency,
cast(PurchaseOrder.PurOrdNetAmountInDisplayCrcy as abap.curr(21,2)) AS PurOrdNetAmountInDisplayCrcy
FROM P_PurOrdItemAcctAssgmt
LEFT OUTER JOIN I_PurchasingCategoryMatlGroup AS PurchasingCategoryMatlGroup ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_Purordmaintaincustproj AS _WBSElement ON WBSElementInternalID = _WBSElement.WBSElementInternalID -- association [1..1]
LEFT OUTER JOIN I_PurchasingOrganization AS _PurchasingOrganization ON PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization -- association [1..1]
LEFT OUTER JOIN I_MaterialGroup AS _MaterialGroup ON MaterialGroup = _MaterialGroup.MaterialGroup -- association [1..1]
LEFT OUTER JOIN I_PurchasingDocumentStatus AS _PurchasingDocumentStatus ON PurchasingDocumentStatus = _PurchasingDocumentStatus.PurchasingDocumentStatus -- 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