P_PurgSpndComprnAcctAssgmt
AccountAssignment for PurchasingSpend Comparison
P_PurgSpndComprnAcctAssgmt is a Consumption CDS View that provides data about "AccountAssignment for PurchasingSpend Comparison" in SAP S/4HANA. It reads from 6 data sources and exposes 68 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber, PurchaseOrderItem, AccountAssignmentNumber.
Data Sources (6)
| Source | Alias | Join Type |
|---|---|---|
| I_PurgDocAccountAssignment | AccountAssignment | left_outer |
| I_PurgDocAccountAssignment | AccountAssignment | left_outer |
| I_PurgDocAccountAssignment | AccountAssignment | left_outer |
| P_PurOrdItmAcctAssgmtDualStack | P_PurOrdItmAcctAssgmtDualStack | from |
| P_PurOrdItmAcctAssgmtDualStack | P_PurOrdItmAcctAssgmtDualStack | union_all |
| P_PurOrdItmAcctAssgmtDualStack | P_PurOrdItmAcctAssgmtDualStack | union_all |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_StartDate | bedat | |
| P_EndDate | bedat |
Annotations (9)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PMMSPNDASSGMT | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.preserveKey | true | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| EndUserText.label | AccountAssignment for PurchasingSpend Comparison | view |
Fields (68)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | PurchaseOrder | Purchasing Document | |
| KEY | PurchaseOrderItem | PurchaseOrderItem | Purchasing Document Item | |
| KEY | AccountAssignmentNumber | I_PurgDocAccountAssignment | AccountAssignmentNumber | Account Assgmt No. |
| Supplier | Supplier | Supplier | ||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| PurchasingGroup | PurchasingGroup | Purchasing Group | ||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| PurchaseOrderType | PurchaseOrderType | PO Type | ||
| PurchaseOrderDate | PurchaseOrderDate | PO Date | ||
| Currency | Currency | Valuation Crcy | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| Material | Material | Vehicle Model | ||
| Plant | Plant | Valuation Area | ||
| PurchaseOrderItemCategory | PurchaseOrderItemCategory | Item Category | ||
| PurchaseOrderCategory | PurchaseOrderCategory | Doc. Category | ||
| ProductType | producttype | Product Type Group | ||
| ServicePerformer | serviceperformer | Service Performer | ||
| MultipleAcctAssgmtDistribution | MultipleAcctAssgmtDistribution | Distribution | ||
| AccountAssignmentCategory | AccountAssignmentCategory | Acct Assgmt Cat | ||
| CostCenter | I_PurgDocAccountAssignment | CostCenter | Cost Center | |
| WBSElementInternalID | I_PurgDocAccountAssignment | WBSElementInternalID | WBS Internal ID | |
| DisplayCurrency | ||||
| P_StartDate | ||||
| PurchasingDocumentItemkeyPurchaseOrder | ||||
| KEY | PurchaseOrderItem | PurchaseOrderItem | Purchasing Document Item | |
| KEY | AccountAssignmentNumber | I_PurgDocAccountAssignment | AccountAssignmentNumber | Account Assgmt No. |
| Supplier | Supplier | Supplier | ||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| PurchasingGroup | PurchasingGroup | Purchasing Group | ||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| PurchaseOrderType | PurchaseOrderType | PO Type | ||
| PurchaseOrderDate | PurchaseOrderDate | PO Date | ||
| Currency | Currency | Valuation Crcy | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| Material | Material | Vehicle Model | ||
| Plant | Plant | Valuation Area | ||
| PurchaseOrderItemCategory | PurchaseOrderItemCategory | Item Category | ||
| PurchaseOrderCategory | PurchaseOrderCategory | Doc. Category | ||
| ProductType | producttype | Product Type Group | ||
| ServicePerformer | serviceperformer | Service Performer | ||
| MultipleAcctAssgmtDistribution | MultipleAcctAssgmtDistribution | Distribution | ||
| AccountAssignmentCategory | AccountAssignmentCategory | Acct Assgmt Cat | ||
| CostCenter | I_PurgDocAccountAssignment | CostCenter | Cost Center | |
| WBSElementInternalID | I_PurgDocAccountAssignment | WBSElementInternalID | WBS Internal ID | |
| DisplayCurrency | ||||
| P_StartDate | ||||
| PurchasingDocumentItemkeyPurchaseOrder | ||||
| KEY | PurchaseOrderItem | PurchaseOrderItem | Purchasing Document Item | |
| KEY | AccountAssignmentNumber | I_PurgDocAccountAssignment | AccountAssignmentNumber | Account Assgmt No. |
| Supplier | Supplier | Supplier | ||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| PurchasingGroup | PurchasingGroup | Purchasing Group | ||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| PurchaseOrderType | PurchaseOrderType | PO Type | ||
| PurchaseOrderDate | PurchaseOrderDate | PO Date | ||
| Currency | Currency | Valuation Crcy | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| Material | Material | Vehicle Model | ||
| Plant | Plant | Valuation Area | ||
| PurchaseOrderItemCategory | PurchaseOrderItemCategory | Item Category | ||
| PurchaseOrderCategory | PurchaseOrderCategory | Doc. Category | ||
| ProductType | producttype | Product Type Group | ||
| ServicePerformer | serviceperformer | Service Performer | ||
| MultipleAcctAssgmtDistribution | MultipleAcctAssgmtDistribution | Distribution | ||
| AccountAssignmentCategory | AccountAssignmentCategory | Acct Assgmt Cat | ||
| CostCenter | I_PurgDocAccountAssignment | CostCenter | Cost Center | |
| WBSElementInternalID | I_PurgDocAccountAssignment | WBSElementInternalID | WBS Internal ID | |
| DisplayCurrency |
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_PurgSpndComprnAcctAssgmt.
-- 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: PMMSPNDASSGMT
-- Parameters: P_DisplayCurrency : displaycurrency, P_StartDate : bedat, P_EndDate : bedat
CREATE VIEW P_PurgSpndComprnAcctAssgmt AS
SELECT
PurchaseOrder,
PurchaseOrderItem,
AccountAssignment.AccountAssignmentNumber AS AccountAssignmentNumber,
Supplier,
PurchasingOrganization,
PurchasingGroup,
CompanyCode,
PurchaseOrderType,
PurchaseOrderDate,
Currency,
MaterialGroup,
Material,
Plant,
PurchaseOrderItemCategory,
PurchaseOrderCategory,
ProductType,
ServicePerformer,
MultipleAcctAssgmtDistribution,
AccountAssignmentCategory,
AccountAssignment.CostCenter AS CostCenter,
AccountAssignment.WBSElementInternalID AS WBSElementInternalID,
cast( :P_DisplayCurrency as displaycurrency ) AS DisplayCurrency,
cast( case when PurchaseOrderItem.AccountAssignmentCategory = 'K' and PurchaseOrderItem.MultipleAcctAssgmtDistribution = '1' then cast( NetPriceInReportingCurrency as purchase_order_net_amount ) * AccountAssignment.Quantity * cast( case when PurchaseOrderItem.IsReturnsItem = 'X' then -1 else 1 end as int2 ) when PurchaseOrderItem.AccountAssignmentCategory = 'K' and PurchaseOrderItem.MultipleAcctAssgmtDistribution = '2' then cast( NetAmountInReportingCurrency as purchase_order_net_amount ) * DIVISION( AccountAssignment.MultipleAcctAssgmtDistrPercent , 100, 3 ) * cast( case when PurchaseOrderItem.IsReturnsItem = 'X' then -1 else 1 end as int2 ) else cast( NetAmountInReportingCurrency as purchase_order_net_amount ) * cast( case when PurchaseOrderItem.IsReturnsItem = 'X' then -1 else 1 end as int2 ) end as purchase_order_net_amount ) as PurOrdNetAmountInDisplayCrcy AS P_StartDate
FROM P_PurOrdItmAcctAssgmtDualStack
LEFT OUTER JOIN I_PurgDocAccountAssignment AS AccountAssignment ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): P_PurOrdItmAcctAssgmtDualStack
;
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