C_SchedgAgrmtItmHistory

DDL: C_SCHEDGAGRMTITMHISTORY SQL: CMMSCAGTITEMHIST Type: view CONSUMPTION

Scheduling Agreement Item History

C_SchedgAgrmtItmHistory is a Consumption CDS View (Cube) that provides data about "Scheduling Agreement Item History" in SAP S/4HANA. It reads from 3 data sources (P_SchedgAgrmtItem01, P_SchedgAgreementItemHistory, I_PurchasingCategoryMatlGroup) and exposes 54 fields with key fields SchedulingAgreement, SchedulingAgreementItem, ScheduleLine, AccountAssignmentNumber, PurchaseOrderTransactionType. It has 9 associations to related views.

Data Sources (3)

SourceAliasJoin Type
P_SchedgAgrmtItem01 NumberOfItems inner
P_SchedgAgreementItemHistory P_SchedgAgreementItemHistory from
I_PurchasingCategoryMatlGroup PurchasingCategoryMatlGroup left_outer

Parameters (3)

NameTypeDefault
P_DisplayCurrency displaycurrency
P_StartDate bedat
P_EndDate bedat

Associations (9)

CardinalityTargetAliasCondition
[1..1] I_PurchasingOrganization _PurchasingOrganization $projection.PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization
[1..1] I_PurchasingGroup _PurchasingGroup $projection.PurchasingGroup = _PurchasingGroup.PurchasingGroup
[1..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[1..1] I_CalendarDate _CalendarDate $projection.ScheduleLineDeliveryDate = _CalendarDate.CalendarDate
[1..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[1..1] I_MaterialGroup _MaterialGroup $projection.MaterialGroup = _MaterialGroup.MaterialGroup
[1..1] I_Material _Material $projection.Material = _Material.Material
[1..1] I_Supplier _Supplier $projection.Supplier = _Supplier.Supplier
[0..1] I_StorageLocation _StorageLocation $projection.Plant = _StorageLocation.Plant and $projection.StorageLocation = _StorageLocation.StorageLocation

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName CMMSCAGTITEMHIST view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
VDM.viewType #CONSUMPTION view
Analytics.dataCategory #CUBE view
Metadata.allowExtensions true view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Scheduling Agreement Item History view

Fields (54)

KeyFieldSource TableSource FieldDescription
KEY SchedulingAgreement SchedulingAgreement SchedulingAgreement Scheduling Agreement
KEY SchedulingAgreementItem SchedulingAgreement SchedulingAgreementItem Schedule Item Number
KEY ScheduleLine ScheduleLine Schedule Line
KEY AccountAssignmentNumber AccountAssignmentNumber Account Assgmt No.
KEY PurchaseOrderTransactionType PurchaseOrderTransactionType
KEY MaterialDocument MaterialDocument Material Doc.
KEY MaterialDocumentItem MaterialDocumentItem Material Document Item
KEY MaterialDocumentYear MaterialDocumentYear Material Document Year
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
Plant Plant Valuation Area
StorageLocation StorageLocation StorageLocation
MaterialGroup SchedulingAgreement MaterialGroup Product Group
Material Material Vehicle Model
PurchasingCategory
PurgCatName
PurchasingDocumentOrderDate PurchasingDocumentOrderDate PO Date
ScheduleLineDeliveryDate ScheduleLineDeliveryDate Delivery Date
CalendarWeek _CalendarDate CalendarWeek Calendar Week
CalendarMonth _CalendarDate CalendarMonth Calendar Month
CalendarQuarter _CalendarDate CalendarQuarter Calendar Quarter
CalendarYear _CalendarDate CalendarYear Year
ProductType ProductType Product Type Group
MaterialType MaterialType Material Type
OrderQuantityUnit OrderQuantityUnit Sales Unit
ScheduleLineOrderQuantity ScheduleLineOrderQuantity Scheduled Qty
GoodsReceiptQuantity GoodsReceiptQuantity Delivered
TargetQuantity TargetQuantity Target Quantity
TargetQuantityInBaseUnit TargetQuantity Target Quantity
AverageTargetQuantity
DisplayCurrency DisplayCurrency Display Currency
AverageTargetAmount
TargetAmountInDisplayCurrency TargetAmount Target Value
SchedulingAgreementSpend SchedulingAgreementSpend
ScheduleLineExpectedSpend ScheduleLineExpectedSpend
GoodsReceiptAmountInDspCrcy GoodsReceiptAmountInDspCrcy
InvoiceAmtInDisplayCurrency InvoiceAmtInDisplayCurrency Invc. Amt Frgn Crcy
NumberOfItems
NumberOfScheduleLines P_SchedgAgrmtItem01 NumberOfScheduleLines
WeightedNetPrice
_CompanyCode _CompanyCode
_Material _Material
_MaterialGroup _MaterialGroup
_Plant _Plant
_PurchasingGroup _PurchasingGroup
_PurchasingOrganization _PurchasingOrganization
_StorageLocation _StorageLocation
_Supplier _Supplier

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_SchedgAgrmtItmHistory.
-- 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: CMMSCAGTITEMHIST
-- Parameters: P_DisplayCurrency : displaycurrency, P_StartDate : bedat, P_EndDate : bedat

CREATE VIEW C_SchedgAgrmtItmHistory AS
SELECT
  SchedulingAgreement.SchedulingAgreement AS SchedulingAgreement,
  SchedulingAgreement.SchedulingAgreementItem AS SchedulingAgreementItem,
  ScheduleLine,
  AccountAssignmentNumber,
  PurchaseOrderTransactionType,
  MaterialDocument,
  MaterialDocumentItem,
  MaterialDocumentYear,
  Supplier,
  PurchasingOrganization,
  PurchasingGroup,
  CompanyCode,
  DocumentCurrency,
  ValidityStartDate,
  ValidityEndDate,
  PurchasingDocumentType,
  Plant,
  StorageLocation,
  SchedulingAgreement.MaterialGroup AS MaterialGroup,
  Material,
  PurchasingCategoryMatlGroup._PurchasingCategory.PurchasingCategory AS PurchasingCategory,
  PurchasingCategoryMatlGroup._PurchasingCategory.PurgCatName AS PurgCatName,
  PurchasingDocumentOrderDate,
  ScheduleLineDeliveryDate,
  _CalendarDate.CalendarWeek AS CalendarWeek,
  _CalendarDate.CalendarMonth AS CalendarMonth,
  _CalendarDate.CalendarQuarter AS CalendarQuarter,
  _CalendarDate.CalendarYear AS CalendarYear,
  ProductType,
  MaterialType,
  OrderQuantityUnit,
  ScheduleLineOrderQuantity,
  GoodsReceiptQuantity,
  TargetQuantity,
  TargetQuantity AS TargetQuantityInBaseUnit,
  DIVISION( TargetQuantity , NumberOfScheduleLines, 3 ) AS AverageTargetQuantity,
  DisplayCurrency,
  cast ( DIVISION( TargetAmount , NumberOfScheduleLines, 3 ) as abap.curr(18,2)) AS AverageTargetAmount,
  TargetAmount AS TargetAmountInDisplayCurrency,
  SchedulingAgreementSpend,
  ScheduleLineExpectedSpend,
  GoodsReceiptAmountInDspCrcy,
  InvoiceAmtInDisplayCurrency,
  cast( 1 as abap.int4 ) AS NumberOfItems,
  NumberOfItems.NumberOfScheduleLines AS NumberOfScheduleLines,
  NumberOfItems.NumberOfScheduleLines * SchedulingAgreementSpend AS WeightedNetPrice
FROM P_SchedgAgreementItemHistory
INNER JOIN P_SchedgAgrmtItem01 AS NumberOfItems ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PurchasingCategoryMatlGroup AS PurchasingCategoryMatlGroup ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PurchasingOrganization AS _PurchasingOrganization ON PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization  -- association [1..1]
LEFT OUTER JOIN I_PurchasingGroup AS _PurchasingGroup ON PurchasingGroup = _PurchasingGroup.PurchasingGroup  -- association [1..1]
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant  -- association [1..1]
LEFT OUTER JOIN I_CalendarDate AS _CalendarDate ON ScheduleLineDeliveryDate = _CalendarDate.CalendarDate  -- association [1..1]
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode  -- association [1..1]
LEFT OUTER JOIN I_MaterialGroup AS _MaterialGroup ON MaterialGroup = _MaterialGroup.MaterialGroup  -- association [1..1]
LEFT OUTER JOIN I_Material AS _Material ON Material = _Material.Material  -- association [1..1]
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier  -- association [1..1]
LEFT OUTER JOIN I_StorageLocation AS _StorageLocation ON Plant = _StorageLocation.Plant AND StorageLocation = _StorageLocation.StorageLocation  -- association [0..1]
;