C_PurgInfoRecdVarcCalc
Consumption view for PIR variance
C_PurgInfoRecdVarcCalc is a Consumption CDS View that provides data about "Consumption view for PIR variance" in SAP S/4HANA. It reads from 1 data source (P_PurgInfoRecdHistVarcCalc) and exposes 12 fields with key fields PurchasingInfoRecord, PurchasingOrganization, PurchasingInfoRecordCategory, Plant, ConditionValidityEndDate. It has 1 association to related views. It is exposed through 1 OData service (ASQL_F2988). Part of development package ODATA_MM_PUR_INFORECPRICH_MNTR.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_PurgInfoRecdHistVarcCalc | P_PurgInfoRecdHistVarcCalc | from |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | P_PurgInfoRecdPrcCalc | _PIRPriceVariance | _PIRPriceVariance.PurchasingInfoRecord = $projection.PurchasingInfoRecord and _PIRPriceVariance.PurchasingOrganization = $projection.PurchasingOrganization and _PIRPriceVariance.Plant = $projection.Plant and _PIRPriceVariance.PurchasingInfoRecordCategory = $projection.PurchasingInfoRecordCategory and _PIRPriceVariance.ConditionValidityEndDate = $projection.FuturePriceValidityStartDate |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | CPIRVARCCALC | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.lifecycle.contract.type | #NONE | view | |
| AccessControl.authorizationCheck | #MANDATORY | view | |
| AccessControl.personalData.blocking | #REQUIRED | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| EndUserText.label | Consumption view for PIR variance | view |
OData Services (1)
| Service | Binding | Version | Contract | Release |
|---|---|---|---|---|
| ASQL_F2988 | ASQL_F2988 | C2 | NOT_RELEASED |
Fields (12)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchasingInfoRecord | PurchasingInfoRecord | Info Record | |
| KEY | PurchasingOrganization | PurchasingOrganization | Purchasing Organization | |
| KEY | PurchasingInfoRecordCategory | PurchasingInfoRecordCategory | Infotype | |
| KEY | Plant | Plant | Valuation Area | |
| KEY | ConditionValidityEndDate | Valid To | ||
| KEY | ConditionRecord | ConditionRecord | Cond.Record No. | |
| ConditionValidityStartDate | ConditionValidityStartDate | Valid From | ||
| ConditionType | ConditionType | Condition type | ||
| Currency | Currency | Valuation Crcy | ||
| NetAmount | NetAmount | Stated Amount | ||
| FuturePriceValidityStartDate | FuturePriceValidityStartDate | Valid from | ||
| NetAmount2else0endasPriceVarianceInPct | Variance |
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_PurgInfoRecdVarcCalc.
-- 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: CPIRVARCCALC
CREATE VIEW C_PurgInfoRecdVarcCalc AS
SELECT
PurchasingInfoRecord,
PurchasingOrganization,
PurchasingInfoRecordCategory,
Plant,
cast(ConditionValidityEndDate as abap.char(8)) AS ConditionValidityEndDate,
ConditionRecord,
ConditionValidityStartDate,
ConditionType,
Currency,
NetAmount,
FuturePriceValidityStartDate,
case when NetAmount is not null and _PIRPriceVariance.NetAmount is not null and _PIRPriceVariance.NetAmount > 0 then division((NetAmount - _PIRPriceVariance.NetAmount ) * 100, _PIRPriceVariance.NetAmount, 2) else 0 end as PriceVarianceInPct AS NetAmount2else0endasPriceVarianceInPct
FROM P_PurgInfoRecdHistVarcCalc
LEFT OUTER JOIN P_PurgInfoRecdPrcCalc AS _PIRPriceVariance ON _PIRPriceVariance.PurchasingInfoRecord = PurchasingInfoRecord AND _PIRPriceVariance.PurchasingOrganization = PurchasingOrganization AND _PIRPriceVariance.Plant = Plant AND _PIRPriceVariance.PurchasingInfoRecordCategory = PurchasingInfoRecordCategory AND _PIRPriceVariance.ConditionValidityEndDate = FuturePriceValidityStartDate -- association [0..1]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- OData Services in SAP S/4HANA Explained
- Service Bindings and Service Definitions in SAP S/4HANA
- 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