P_PurInfoRecdPOPrHist

DDL: P_PURINFORECDPOPRHIST SQL: PPIRPOPRHIST Type: view CONSUMPTION

Union View for PIR Price Change by PO

P_PurInfoRecdPOPrHist is a Consumption CDS View that provides data about "Union View for PIR Price Change by PO" in SAP S/4HANA. It reads from 2 data sources (P_PurgInfoRecdOrdPrcCalc, P_PurgInfoRecdOrdPrcCalc) and exposes 81 fields with key fields PurchasingInfoRecord, PurchasingOrganization, PurchasingInfoRecordCategory, Plant, ConditionValidityEndDate. It has 2 associations to related views.

Data Sources (2)

SourceAliasJoin Type
P_PurgInfoRecdOrdPrcCalc _Header from
P_PurgInfoRecdOrdPrcCalc _OrderPrice union_all

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_PurchasingInfoRecord _InfoRecord $projection.PurchasingInfoRecord = _InfoRecord.PurchasingInfoRecord
[0..1] I_PurgInfoRecdOrgPlantData _PlantData $projection.PurchasingInfoRecord = _PlantData.PurchasingInfoRecord and _Header.ReferenceDocumentPlant = _PlantData.Plant and $projection.PurchasingInfoRecordCategory = _PlantData.PurchasingInfoRecordCategory and $projection.PurchasingOrganization = _PlantData.PurchasingOrganization

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PPIRPOPRHIST view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
EndUserText.label Union View for PIR Price Change by PO view
VDM.private true view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
Metadata.ignorePropagatedAnnotations true view

Fields (81)

KeyFieldSource TableSource FieldDescription
KEY PurchasingInfoRecord P_PurgInfoRecdOrdPrcCalc PurchasingInfoRecord Info Record
KEY PurchasingOrganization P_PurgInfoRecdOrdPrcCalc PurchasingOrganization Purchasing Organization
KEY PurchasingInfoRecordCategory P_PurgInfoRecdOrdPrcCalc PurchasingInfoRecordCategory Infotype
KEY Plant P_PurgInfoRecdOrdPrcCalc Plant Valuation Area
KEY ConditionValidityEndDate PO Date
KEY PurchasingDocument Purchasing Document
KEY PurchasingDocumentItem Purchasing Doc. Item
Currency P_PurgInfoRecdOrdPrcCalc ReferenceDocumentCrcy
BaseUnit P_PurgInfoRecdOrdPrcCalc ReferenceDocumentUnit
NetAmount Net Price
ConditionRateValueUnit Valuation Crcy
ConditionQuantity Order Price Un.
ConditionQuantityUnit Order Price Un.
NumberOfItems
HierarchyNodeLevel
PurgDocDrillDownState
PurchasingDocumentType
ParentNode
char50asFormattedPurDoc
FormattedPurchaseOrderItem
ConditionValidityStartDate PO Date
ConditionIsDeleted
Supplier _InfoRecord Supplier Supplier
Material _InfoRecord Material Vehicle Model
MaterialGroupendasMaterialGroup
SupplierSubrange _InfoRecord SupplierSubrange Suppl. Subrange
Manufacturer _InfoRecord Manufacturer Manufacturer
PriorSupplier _InfoRecord PriorSupplier Prior Supplier
SupplierMaterialNumber _InfoRecord SupplierMaterialNumber Supp. Mat. No.
IsDeleted _InfoRecord IsDeleted TRUE
AvailabilityStartDate _InfoRecord AvailabilityStartDate Available from
AvailabilityEndDate _InfoRecord AvailabilityEndDate Available to
SupplierName
PurchasingGroup _PlantData PurchasingGroup Purchasing Group
IncotermsClassification _PlantData IncotermsClassification Incoterms
TaxCode _PlantData TaxCode Tax Code
PricingDateControl _PlantData PricingDateControl Pr. Date Cat.
MaterialPlannedDeliveryDurn _PlantData MaterialPlannedDeliveryDurn Pl. Deliv. Time
OverdelivTolrtdLmtRatioInPct _PlantData OverdelivTolrtdLmtRatioInPct Overdeliv. Tol.
UnderdelivTolrtdLmtRatioInPct _PlantData UnderdelivTolrtdLmtRatioInPct Underdel. Tol.
PurchasingInfoRecord Info Record
KEY PurchasingOrganization P_PurgInfoRecdOrdPrcCalc PurchasingOrganization Purchasing Organization
KEY PurchasingInfoRecordCategory P_PurgInfoRecdOrdPrcCalc PurchasingInfoRecordCategory Infotype
KEY Plant P_PurgInfoRecdOrdPrcCalc Plant Valuation Area
KEY ConditionValidityEndDate P_PurgInfoRecdOrdPrcCalc PurchasingDocumentOrderDate PO Date
KEY PurchasingDocument P_PurgInfoRecdOrdPrcCalc PurchasingDocument Purchasing Document
KEY PurchasingDocumentItem P_PurgInfoRecdOrdPrcCalc PurchasingDocumentItem Purchasing Doc. Item
Currency P_PurgInfoRecdOrdPrcCalc ReferenceDocumentCrcy
BaseUnit P_PurgInfoRecdOrdPrcCalc ReferenceDocumentUnit
NetAmount P_PurgInfoRecdOrdPrcCalc PurgDocNetPriceAmount Net Price
ConditionRateValueUnit P_PurgInfoRecdOrdPrcCalc Currency Valuation Crcy
ConditionQuantity P_PurgInfoRecdOrdPrcCalc PurchaseOrderPriceUnit Order Price Un.
ConditionQuantityUnit P_PurgInfoRecdOrdPrcCalc OrderPriceUnit Order Price Un.
NumberOfItems 0
HierarchyNodeLevel
PurgDocDrillDownState
PurchasingDocumentType
PlantasParentNode
FormattedPurDoc FormattedPurchaseOrderItem
FormattedPurchaseOrderItem FormattedPurchaseOrderItem
ConditionValidityStartDate P_PurgInfoRecdOrdPrcCalc PurchasingDocumentOrderDate PO Date
ConditionIsDeleted
Supplier _InfoRecord Supplier Supplier
Material _InfoRecord Material Vehicle Model
MaterialGroupendasMaterialGroup
SupplierSubrange _InfoRecord SupplierSubrange Suppl. Subrange
Manufacturer _InfoRecord Manufacturer Manufacturer
PriorSupplier _InfoRecord PriorSupplier Prior Supplier
SupplierMaterialNumber _InfoRecord SupplierMaterialNumber Supp. Mat. No.
IsDeleted _InfoRecord IsDeleted TRUE
AvailabilityStartDate _InfoRecord AvailabilityStartDate Available from
AvailabilityEndDate _InfoRecord AvailabilityEndDate Available to
SupplierName
PurchasingGroup _PlantData PurchasingGroup Purchasing Group
IncotermsClassification _PlantData IncotermsClassification Incoterms
TaxCode _PlantData TaxCode Tax Code
PricingDateControl _PlantData PricingDateControl Pr. Date Cat.
MaterialPlannedDeliveryDurn _PlantData MaterialPlannedDeliveryDurn Pl. Deliv. Time
OverdelivTolrtdLmtRatioInPct _PlantData OverdelivTolrtdLmtRatioInPct Overdeliv. Tol.
UnderdelivTolrtdLmtRatioInPct _PlantData UnderdelivTolrtdLmtRatioInPct Underdel. Tol.
TaxCalculationProcedure

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_PurInfoRecdPOPrHist.
-- 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: PPIRPOPRHIST

CREATE VIEW P_PurInfoRecdPOPrHist AS
SELECT
  _Header.PurchasingInfoRecord AS PurchasingInfoRecord,
  _Header.PurchasingOrganization AS PurchasingOrganization,
  _Header.PurchasingInfoRecordCategory AS PurchasingInfoRecordCategory,
  _Header.Plant AS Plant,
  '00000000' AS ConditionValidityEndDate,
  cast('_' as ebeln) AS PurchasingDocument,
  cast('00000' as ebelp) AS PurchasingDocumentItem,
  _Header.ReferenceDocumentCrcy AS Currency,
  _Header.ReferenceDocumentUnit AS BaseUnit,
  cast(0 as kbetr_kond) AS NetAmount,
  cast('_' as konwa) AS ConditionRateValueUnit,
  cast(0 as epein) AS ConditionQuantity,
  cast('_' as kmein) AS ConditionQuantityUnit,
  cast(0 as abap.int4 ) AS NumberOfItems,
  cast('0' as abap.char(1)) AS HierarchyNodeLevel,
  cast('expanded' as abap.char(8)) AS PurgDocDrillDownState,
  cast('0' as abap.char(1)) AS PurchasingDocumentType,
  cast(' ' as abap.char(50)) AS ParentNode,
  cast(concat(concat(concat(concat(concat(concat(_Header.PurchasingInfoRecord, '/'), _Header.PurchasingOrganization),'/'), _Header.PurchasingInfoRecordCategory),'/'), _Header.Plant) as abap.char(50)) as FormattedPurDoc AS char50asFormattedPurDoc,
  cast('_' as abap.char(50)) AS FormattedPurchaseOrderItem,
  cast('00000000' as abap.dats) AS ConditionValidityStartDate,
  '_' AS ConditionIsDeleted,
  _InfoRecord.Supplier AS Supplier,
  _InfoRecord.Material AS Material,
  case when _InfoRecord.MaterialGroup = '' then _InfoRecord._Material.MaterialGroup else _InfoRecord.MaterialGroup end as MaterialGroup AS MaterialGroupendasMaterialGroup,
  _InfoRecord.SupplierSubrange AS SupplierSubrange,
  _InfoRecord.Manufacturer AS Manufacturer,
  _InfoRecord.PriorSupplier AS PriorSupplier,
  _InfoRecord.SupplierMaterialNumber AS SupplierMaterialNumber,
  _InfoRecord.IsDeleted AS IsDeleted,
  _InfoRecord.AvailabilityStartDate AS AvailabilityStartDate,
  _InfoRecord.AvailabilityEndDate AS AvailabilityEndDate,
  _InfoRecord._Supplier.SupplierName AS SupplierName,
  _PlantData.PurchasingGroup AS PurchasingGroup,
  _PlantData.IncotermsClassification AS IncotermsClassification,
  _PlantData.TaxCode AS TaxCode,
  _PlantData.PricingDateControl AS PricingDateControl,
  _PlantData.MaterialPlannedDeliveryDurn AS MaterialPlannedDeliveryDurn,
  _PlantData.OverdelivTolrtdLmtRatioInPct AS OverdelivTolrtdLmtRatioInPct,
  _PlantData.UnderdelivTolrtdLmtRatioInPct AS UnderdelivTolrtdLmtRatioInPct,
  concat(concat(concat(concat(concat(concat(_OrderPrice.PurchasingInfoRecord, '/'), _OrderPrice.PurchasingOrganization),'/'), _OrderPrice.PurchasingInfoRecordCategory),'/'), _OrderPrice.Plant) as ParentNode AS PlantasParentNode,
  FormattedPurchaseOrderItem AS FormattedPurDoc,
  _PlantData._Plant._StandardOrganizationAddress._Country.TaxCalculationProcedure AS TaxCalculationProcedure
FROM P_PurgInfoRecdOrdPrcCalc AS _Header
LEFT OUTER JOIN I_PurchasingInfoRecord AS _InfoRecord ON PurchasingInfoRecord = _InfoRecord.PurchasingInfoRecord  -- association [0..1]
LEFT OUTER JOIN I_PurgInfoRecdOrgPlantData AS _PlantData ON PurchasingInfoRecord = _PlantData.PurchasingInfoRecord AND _Header.ReferenceDocumentPlant = _PlantData.Plant AND PurchasingInfoRecordCategory = _PlantData.PurchasingInfoRecordCategory AND PurchasingOrganization = _PlantData.PurchasingOrganization  -- association [0..1]
-- UNION ALL with additional select branch(es): P_PurgInfoRecdOrdPrcCalc
;