P_SchedLineGIQty

DDL: P_SCHEDLINEGIQTY SQL: PSCHGIQTY Type: view COMPOSITE

P_SchedLineGIQty is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_SubcontractingComponent) and exposes 12 fields with key fields PurchasingDocument, PurchasingDocumentItem, ScheduleLine, Material, Supplier. It has 2 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_SubcontractingComponent I_SubcontractingComponent from

Associations (2)

CardinalityTargetAliasCondition
[1..1] P_GdsIssQtyAggrgn _GdsIssQtyAggrgn _GdsIssQtyAggrgn.PurchasingDocument = $projection.PurchasingDocument and _GdsIssQtyAggrgn.PurchasingDocumentItem = $projection.PurchasingDocumentItem and _GdsIssQtyAggrgn.Material = $projection.Material and _GdsIssQtyAggrgn.Supplier = $projection.Supplier and _GdsIssQtyAggrgn.Plant = $projection.Plant
[1..1] P_SubcontrgOrdsSchedLines _SubcontrgOrdsSchedLines _SubcontrgOrdsSchedLines.PurchasingDocument = $projection.PurchasingDocument and _SubcontrgOrdsSchedLines.PurchasingDocumentItem = $projection.PurchasingDocumentItem and _SubcontrgOrdsSchedLines.ScheduleLine = $projection.ScheduleLine and _SubcontrgOrdsSchedLines.Material = $projection.Material and _SubcontrgOrdsSchedLines.Supplier = $projection.Supplier and _SubcontrgOrdsSchedLines.Plant = $projection.Plant and _SubcontrgOrdsSchedLines.RequirementDate = $projection.RequirementDate and _SubcontrgOrdsSchedLines.Reservation = $projection.Reservation and _SubcontrgOrdsSchedLines.ReservationItem = $projection.ReservationItem

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PSCHGIQTY view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (12)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocument PurchasingDocument Purchasing Document
KEY PurchasingDocumentItem PurchasingDocumentItem Purchasing Doc. Item
KEY ScheduleLine ScheduleLine Schedule Line
KEY Material Material Vehicle Model
KEY Supplier Supplier Supplier
KEY Plant Plant Valuation Area
KEY RequirementDate RequirementDate Requirement Date
KEY Reservation Reservation Reservation
KEY ReservationItem ReservationItem Reservation Item
TotalGIPerPO _GdsIssQtyAggrgn TotalGIPerPO
CummulativeSheduleQuantity _SubcontrgOrdsSchedLines CummulativeSheduleQuantity
quan133asGIDonePerScheduleLineQty

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_SchedLineGIQty.
-- 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: PSCHGIQTY

CREATE VIEW P_SchedLineGIQty AS
SELECT
  PurchasingDocument,
  PurchasingDocumentItem,
  ScheduleLine,
  Material,
  Supplier,
  Plant,
  RequirementDate,
  Reservation,
  ReservationItem,
  _GdsIssQtyAggrgn.TotalGIPerPO AS TotalGIPerPO,
  _SubcontrgOrdsSchedLines.CummulativeSheduleQuantity AS CummulativeSheduleQuantity,
  cast( case when _SubcontrgOrdsSchedLines.CummulativeSheduleQuantity is null and _GdsIssQtyAggrgn.TotalGIPerPO is null then cast (0 as bdmng) when _GdsIssQtyAggrgn.TotalGIPerPO is null then (0 - _SubcontrgOrdsSchedLines.CummulativeSheduleQuantity) else (_GdsIssQtyAggrgn.TotalGIPerPO - coalesce( _SubcontrgOrdsSchedLines.CummulativeSheduleQuantity, 0 ) ) end as abap.quan(13,3)) as GIDonePerScheduleLineQty AS quan133asGIDonePerScheduleLineQty
FROM I_SubcontractingComponent
LEFT OUTER JOIN P_GdsIssQtyAggrgn AS _GdsIssQtyAggrgn ON _GdsIssQtyAggrgn.PurchasingDocument = PurchasingDocument AND _GdsIssQtyAggrgn.PurchasingDocumentItem = PurchasingDocumentItem AND _GdsIssQtyAggrgn.Material = Material AND _GdsIssQtyAggrgn.Supplier = Supplier AND _GdsIssQtyAggrgn.Plant = Plant  -- association [1..1]
LEFT OUTER JOIN P_SubcontrgOrdsSchedLines AS _SubcontrgOrdsSchedLines ON _SubcontrgOrdsSchedLines.PurchasingDocument = PurchasingDocument AND _SubcontrgOrdsSchedLines.PurchasingDocumentItem = PurchasingDocumentItem AND _SubcontrgOrdsSchedLines.ScheduleLine = ScheduleLine AND _SubcontrgOrdsSchedLines.Material = Material AND _SubcontrgOrdsSchedLines.Supplier = Supplier AND _SubcontrgOrdsSchedLines.Plant = Plant AND _SubcontrgOrdsSchedLines.RequirementDate = RequirementDate AND _SubcontrgOrdsSchedLines.Reservation = Reservation AND _SubcontrgOrdsSchedLines.ReservationItem = ReservationItem  -- association [1..1]
;