P_SchedgAgrmtItmDelivCalc

DDL: P_SCHEDGAGRMTITMDELIVCALC SQL: PSAITMDELCAL Type: view CONSUMPTION

Scheduling Agreement Calculations

P_SchedgAgrmtItmDelivCalc is a Consumption CDS View that provides data about "Scheduling Agreement Calculations" in SAP S/4HANA. It reads from 2 data sources (P_SchedgAgrmtItmSchLineData, I_SchedgAgrmtItm) and exposes 20 fields with key fields SchedulingAgreement, SchedulingAgreementItem. It has 1 association to related views.

Data Sources (2)

SourceAliasJoin Type
P_SchedgAgrmtItmSchLineData NextScheduleLine left_outer
I_SchedgAgrmtItm SchedulingAgreementItem from

Associations (1)

CardinalityTargetAliasCondition
[1..1] P_SchedgAgrmtItmGRQty _SAItemGR _SAItemGR.SchedulingAgreement = SchedulingAgreementItem.SchedulingAgreement and _SAItemGR.SchedulingAgreementItem = SchedulingAgreementItem.SchedulingAgreementItem

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PSAITMDELCAL view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
EndUserText.label Scheduling Agreement Calculations view
VDM.private true view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view

Fields (20)

KeyFieldSource TableSource FieldDescription
KEY SchedulingAgreement I_SchedgAgrmtItm SchedulingAgreement Scheduling Agreement
KEY SchedulingAgreementItem I_SchedgAgrmtItm SchedulingAgreementItem Schedule Item Number
ScheduleLine P_SchedgAgrmtItmSchLineData ScheduleLine Schedule Line
TargetQuantity I_SchedgAgrmtItm TargetQuantity Target Quantity
NetPriceAmount I_SchedgAgrmtItm NetPriceAmount Net Price
NetAmount
ScheduleLineOrderQuantity P_SchedgAgrmtItmSchLineData ScheduleLineOrderQuantity Scheduled Qty
RoughGoodsReceiptQty P_SchedgAgrmtItmSchLineData RoughGoodsReceiptQty Delivered
ReleasedQuantityendasReleasedQuantity
GoodsReceiptQtyendasGoodsReceiptQty
OrderQuantityUnit I_SchedgAgrmtItm OrderQuantityUnit Sales Unit
DocumentCurrency DocumentCurrency Document Currency
GoodsReceiptIsExpected I_SchedgAgrmtItm GoodsReceiptIsExpected Goods Receipt
TodayDate
PurchasingDocumentItemCategory PurchasingDocumentItemCategory Item Category
Plant I_SchedgAgrmtItm Plant Valuation Area
StorageLocation I_SchedgAgrmtItm StorageLocation StorageLocation
PurchasingDocumentType
PurchasingOrganization
PurchasingGroup

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_SchedgAgrmtItmDelivCalc.
-- 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: PSAITMDELCAL

CREATE VIEW P_SchedgAgrmtItmDelivCalc AS
SELECT
  SchedulingAgreementItem.SchedulingAgreement AS SchedulingAgreement,
  SchedulingAgreementItem.SchedulingAgreementItem AS SchedulingAgreementItem,
  NextScheduleLine.ScheduleLine AS ScheduleLine,
  SchedulingAgreementItem.TargetQuantity AS TargetQuantity,
  SchedulingAgreementItem.NetPriceAmount AS NetPriceAmount,
  SchedulingAgreementItem.TargetQuantity * division(SchedulingAgreementItem.NetPriceAmount, SchedulingAgreementItem.NetPriceQuantity, 2) AS NetAmount,
  NextScheduleLine.ScheduleLineOrderQuantity AS ScheduleLineOrderQuantity,
  NextScheduleLine.RoughGoodsReceiptQty AS RoughGoodsReceiptQty,
  case when (_SAItemGR.ReleasedQuantity is null) then cast (0 as abap.quan(13,3)) else _SAItemGR.ReleasedQuantity end as ReleasedQuantity AS ReleasedQuantityendasReleasedQuantity,
  case when (_SAItemGR.GoodsReceiptQty is null or SchedulingAgreementItem.GoodsReceiptIsExpected <> 'X') then cast(0 as abap.quan(13,3)) else _SAItemGR.GoodsReceiptQty end as GoodsReceiptQty AS GoodsReceiptQtyendasGoodsReceiptQty,
  SchedulingAgreementItem.OrderQuantityUnit AS OrderQuantityUnit,
  DocumentCurrency,
  SchedulingAgreementItem.GoodsReceiptIsExpected AS GoodsReceiptIsExpected,
  $session.system_date AS TodayDate,
  PurchasingDocumentItemCategory,
  SchedulingAgreementItem.Plant AS Plant,
  SchedulingAgreementItem.StorageLocation AS StorageLocation,
  SchedulingAgreementItem._Schedgagrmthdr.PurchasingDocumentType AS PurchasingDocumentType,
  SchedulingAgreementItem._Schedgagrmthdr.PurchasingOrganization AS PurchasingOrganization,
  SchedulingAgreementItem._Schedgagrmthdr.PurchasingGroup AS PurchasingGroup
FROM I_SchedgAgrmtItm AS SchedulingAgreementItem
LEFT OUTER JOIN P_SchedgAgrmtItmSchLineData AS NextScheduleLine ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_SchedgAgrmtItmGRQty AS _SAItemGR ON _SAItemGR.SchedulingAgreement = SchedulingAgreementItem.SchedulingAgreement AND _SAItemGR.SchedulingAgreementItem = SchedulingAgreementItem.SchedulingAgreementItem  -- association [1..1]
;