P_SchedgAgrmtItemHistory

DDL: P_SCHEDGAGRMTITEMHISTORY SQL: PSCAGTITMHIS Type: view CONSUMPTION Package: ODATA_MM_ANALYTICS

Scheduling Agreement Item History

P_SchedgAgrmtItemHistory is a Consumption CDS View that provides data about "Scheduling Agreement Item History" in SAP S/4HANA. It reads from 1 data source (P_SchedgAgrmtItemHistory1) and exposes 40 fields with key fields SchedulingAgreement, SchedulingAgreementItem. It has 7 associations to related views. Part of development package ODATA_MM_ANALYTICS.

Data Sources (1)

SourceAliasJoin Type
P_SchedgAgrmtItemHistory1 P_SchedgAgrmtItemHistory1 from

Parameters (1)

NameTypeDefault
P_DisplayCurrency displaycurrency

Associations (7)

CardinalityTargetAliasCondition
[0..1] P_SchedAgrmtDelivSchedule _DelivSchedule _DelivSchedule.SchedulingAgreement = SchedulingAgreementItem.SchedulingAgreement and _DelivSchedule.SchedulingAgreementItem = SchedulingAgreementItem.SchedulingAgreementItem
[0..1] P_SchedAgrmtOverdueQtyCalc _OverdueQty _OverdueQty.SchedulingAgreement = SchedulingAgreementItem.SchedulingAgreement and _OverdueQty.SchedulingAgreementItem = SchedulingAgreementItem.SchedulingAgreementItem
[0..1] P_SchedAgrmtDueDelivQtyCalc _DueDelivQty _DueDelivQty.SchedulingAgreement = SchedulingAgreementItem.SchedulingAgreement and _DueDelivQty.SchedulingAgreementItem = SchedulingAgreementItem.SchedulingAgreementItem
[0..1] I_ProcmtDelivSchedDate _NextDeliveryDateText $projection.SchedgAgreementItemNextRelDate = _NextDeliveryDateText.PlannedDeliveryDuration
[0..1] I_SchedgAgrmtOverdueDelivSts _DeliveryStatusText $projection.SchedAgrmtItemIsOverdue = _DeliveryStatusText.SchedAgrmtItemIsOverdue
[0..1] I_ProcmtApprovalStsWthDelivDte _ApprovalStatusText $projection.SchedAgrmtItmInApprvlSts = _ApprovalStatusText.SchedAgrmtItmInApprvlSts
[0..1] I_PurContrValidityText _ValidityStatusText $projection.SchedAgrmtValidityStatus = _ValidityStatusText.PurchaseContractValidityStatus and _ValidityStatusText.Language = $session.system_language

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PSCAGTITMHIS view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Scheduling Agreement Item History view
VDM.private true view
VDM.viewType #CONSUMPTION view

Fields (40)

KeyFieldSource TableSource FieldDescription
KEY SchedulingAgreement SchedulingAgreementItem SchedulingAgreement Scheduling Agreement
KEY SchedulingAgreementItem SchedulingAgreementItem SchedulingAgreementItem Schedule Item Number
Supplier Supplier Supplier
PurchasingOrganization PurchasingOrganization Purchasing Organization
PurchasingGroup PurchasingGroup Purchasing Group
CompanyCode CompanyCode Receiver Company Code
DocumentCurrency DocumentCurrency Document Currency
ValidityStartDate ValidityStartDate Validity Start Date
ValidityEndDate ValidityEndDate ValidTo
PurchasingDocumentType PurchasingDocumentType RFQ Type
PurchasingDocumentCategory PurchasingDocumentCategory Doc. Category
Plant Plant Valuation Area
StorageLocation StorageLocation StorageLocation
MaterialGroup MaterialGroup Product Group
Material Material Vehicle Model
NetPriceAmount NetPriceAmount Net Price
NetPriceQuantity NetPriceQuantity Price Unit
OrderQuantityUnit OrderQuantityUnit Sales Unit
ScheduleLineOrderQuantity
PurchasingDocumentOrderDate PurchasingDocumentOrderDate PO Date
OrderPriceUnitToOrderUnitNmrtr OrderPriceUnitToOrderUnitNmrtr Quantity Conversion Numerator
OrdPriceUnitToOrderUnitDnmntr OrdPriceUnitToOrderUnitDnmntr Quantity Conversion Denominator
ProductType ProductType Product Type Group
MaterialType MaterialType Material Type
TargetQuantity TargetQuantity Target Quantity
DisplayCurrency
TargetAmount Target Value
SchedulingAgreementSpend
GoodsReceiptAmountInDspCrcy
InvoiceAmtInDisplayCurrency
GoodsReceiptQuantity Delivered
InvoiceReceiptQty
SchedgAgrmtItmDueDeliveryQty _DueDelivQty SchedgAgrmtItmDueDeliveryQty
SchedgAgrmtItmOverdueQty _OverdueQty SchedgAgrmtItmOverdueQty
SchedgAgrmtItmNextDelivQty _DelivSchedule ScheduleLineOrderQuantity Scheduled Qty
NextDeliveryDate _DelivSchedule ScheduleLineDeliveryDate Delivery Date
_NextDeliveryDateText _NextDeliveryDateText
_DeliveryStatusText _DeliveryStatusText
_ApprovalStatusText _ApprovalStatusText
_ValidityStatusText _ValidityStatusText

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_SchedgAgrmtItemHistory.
-- 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: PSCAGTITMHIS
-- Parameters: P_DisplayCurrency : displaycurrency

CREATE VIEW P_SchedgAgrmtItemHistory AS
SELECT
  SchedulingAgreementItem.SchedulingAgreement AS SchedulingAgreement,
  SchedulingAgreementItem.SchedulingAgreementItem AS SchedulingAgreementItem,
  Supplier,
  PurchasingOrganization,
  PurchasingGroup,
  CompanyCode,
  DocumentCurrency,
  ValidityStartDate,
  ValidityEndDate,
  PurchasingDocumentType,
  PurchasingDocumentCategory,
  Plant,
  StorageLocation,
  MaterialGroup,
  Material,
  NetPriceAmount,
  NetPriceQuantity,
  OrderQuantityUnit,
  cast(SchedulingAgreementItem.ScheduleLineOrderQuantity as mm_schedg_agrmt_target_qty ) AS ScheduleLineOrderQuantity,
  PurchasingDocumentOrderDate,
  OrderPriceUnitToOrderUnitNmrtr,
  OrdPriceUnitToOrderUnitDnmntr,
  ProductType,
  MaterialType,
  TargetQuantity,
  cast( $parameters.P_DisplayCurrency as displaycurrency) AS DisplayCurrency,
  cast(TargetAmount as mm_a_target_amount) AS TargetAmount,
  cast( SchedulingAgreementItem.ScheduleLineOrderQuantity * NetPriceAmount as mm_a_released_amt ) AS SchedulingAgreementSpend,
  cast( GoodsReceiptAmountInDspCrcy as mm_goods_receipt_amount ) AS GoodsReceiptAmountInDspCrcy,
  cast( InvoiceAmtInDisplayCurrency as mm_pur_ana_de_invoice_amount ) AS InvoiceAmtInDisplayCurrency,
  cast( GoodsReceiptQuantity as mm_schedg_agrmt_goods_receipt ) AS GoodsReceiptQuantity,
  cast (InvoiceReceiptQty as abap.quan(13, 3) ) AS InvoiceReceiptQty,
  _DueDelivQty.SchedgAgrmtItmDueDeliveryQty AS SchedgAgrmtItmDueDeliveryQty,
  _OverdueQty.SchedgAgrmtItmOverdueQty AS SchedgAgrmtItmOverdueQty,
  _DelivSchedule.ScheduleLineOrderQuantity AS SchedgAgrmtItmNextDelivQty,
  _DelivSchedule.ScheduleLineDeliveryDate AS NextDeliveryDate
FROM P_SchedgAgrmtItemHistory1
LEFT OUTER JOIN P_SchedAgrmtDelivSchedule AS _DelivSchedule ON _DelivSchedule.SchedulingAgreement = SchedulingAgreementItem.SchedulingAgreement AND _DelivSchedule.SchedulingAgreementItem = SchedulingAgreementItem.SchedulingAgreementItem  -- association [0..1]
LEFT OUTER JOIN P_SchedAgrmtOverdueQtyCalc AS _OverdueQty ON _OverdueQty.SchedulingAgreement = SchedulingAgreementItem.SchedulingAgreement AND _OverdueQty.SchedulingAgreementItem = SchedulingAgreementItem.SchedulingAgreementItem  -- association [0..1]
LEFT OUTER JOIN P_SchedAgrmtDueDelivQtyCalc AS _DueDelivQty ON _DueDelivQty.SchedulingAgreement = SchedulingAgreementItem.SchedulingAgreement AND _DueDelivQty.SchedulingAgreementItem = SchedulingAgreementItem.SchedulingAgreementItem  -- association [0..1]
LEFT OUTER JOIN I_ProcmtDelivSchedDate AS _NextDeliveryDateText ON SchedgAgreementItemNextRelDate = _NextDeliveryDateText.PlannedDeliveryDuration  -- association [0..1]
LEFT OUTER JOIN I_SchedgAgrmtOverdueDelivSts AS _DeliveryStatusText ON SchedAgrmtItemIsOverdue = _DeliveryStatusText.SchedAgrmtItemIsOverdue  -- association [0..1]
LEFT OUTER JOIN I_ProcmtApprovalStsWthDelivDte AS _ApprovalStatusText ON SchedAgrmtItmInApprvlSts = _ApprovalStatusText.SchedAgrmtItmInApprvlSts  -- association [0..1]
LEFT OUTER JOIN I_PurContrValidityText AS _ValidityStatusText ON SchedAgrmtValidityStatus = _ValidityStatusText.PurchaseContractValidityStatus AND _ValidityStatusText.Language = $session.system_language  -- association [0..1]
;