C_PurgInfoRecdVarcCalc

DDL: C_PURGINFORECDVARCCALC SQL: CPIRVARCCALC Type: view CONSUMPTION Package: ODATA_MM_PUR_INFORECPRICH_MNTR

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)

SourceAliasJoin Type
P_PurgInfoRecdHistVarcCalc P_PurgInfoRecdHistVarcCalc from

Associations (1)

CardinalityTargetAliasCondition
[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)

NameValueLevelField
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)

ServiceBindingVersionContractRelease
ASQL_F2988 ASQL_F2988 C2 NOT_RELEASED

Fields (12)

KeyFieldSource TableSource FieldDescription
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]
;