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_PurgDocSuplrConf.
-- 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: PPOSUPLRCONF
CREATE VIEW P_PurgDocSuplrConf AS
SELECT
I_PurchasingDocumentItem.PurchasingDocument AS PurchasingDocumentNumber,
I_PurchasingDocumentItem.PurchasingDocumentItem AS PurchasingDocumentItemNumber,
P_PurgDocSchedulelineCuml.ScheduleLine AS ScheduleLine,
I_PurchasingDocumentItem._Material._Text[1: Language = $session.system_language].MaterialName AS MaterialName,
I_PurchasingDocumentItem.AccountAssignmentCategory AS AccountAssignmentCategory,
I_PurchasingDocumentItem._AccountAssignmentCategory._Text[1: Language = $session.system_language].AcctAssignmentCategoryName AS AcctAssignmentCategoryName,
I_PurchasingDocumentItem._CompanyCode.CompanyCodeName AS CompanyCodeName,
I_PurchasingDocumentItem._PurchasingDocument.PurchasingGroup AS PurchasingGroup,
I_PurchasingDocumentItem.SupplierConfirmationControlKey AS ConfirmationControl,
I_PurchasingDocumentItem.Material AS Material,
I_PurchasingDocumentItem.MaterialGroup AS MaterialGroup,
I_SupplierConfirmationControl.SupplierConfirmationCategory AS SupplierConfirmationCategory,
I_SupplierConfirmationControl._SuplrConfCategory._Text.SupplierConfCategoryName AS SupplierConfCategoryName,
I_PurchasingDocumentItem._PurchasingDocument.PurchasingOrganization AS PurchasingOrganization,
I_PurchasingDocumentItem._PurchasingDocument.PurchasingDocumentType AS PurchasingDocumentType,
I_PurchasingDocumentItem._PurchasingDocument.PurchasingDocumentOrderDate AS DocumentDate,
P_PurgDocSchedulelineCuml.ScheduleLineDeliveryDate AS ItemDeliveryDate,
P_PurgDocSchedulelineCuml.DelivDateCategory AS DelivDateCategory,
I_PurchasingDocumentItem._PurchasingDocument.Supplier AS Supplier,
I_PurchasingDocumentItem.DocumentCurrency AS DocumentCurrency,
I_PurchasingDocumentItem.NetPriceAmount AS NetPriceAmount,
I_PurchasingDocumentItem.NetPriceQuantity AS NetPriceQuantity,
I_PurchasingDocumentItem._PurchasingDocument._Supplier.SupplierName AS SupplierName,
I_PurchasingDocumentItem.PurchasingDocumentCategory AS PurchasingDocumentCategory,
I_PurchasingDocumentItem.OrderQuantity AS OrderQuantity,
I_PurchasingDocumentItem.ManufacturerMaterial AS MaterialNumber,
I_PurchasingDocumentItem.PurchasingDocumentItemText AS ShortText,
I_PurchasingDocumentItem.Plant AS Plant,
I_PurchasingDocumentItem._Plant.PlantName AS PlantName,
I_PurchasingDocumentItem._PurchasingDocument._PurchasingOrganization.PurchasingOrganizationName AS PurchasingOrganizationName,
I_PurchasingDocumentItem._PurchasingDocument._PurchasingGroup.PurchasingGroupName AS PurchasingGroupName,
I_PurchasingDocumentItem._PurchasingDocument.PurchasingDocumentName AS PurchasingDocumentName,
I_PurchasingDocumentItem.NetAmount AS NetAmount,
I_PurchasingDocumentItem.PurchasingDocumentDeletionCode AS PurchasingDocumentDeletionCode,
I_PurchasingDocumentItem.CompanyCode AS CompanyCode,
I_PurchasingDocumentItem.PurchasingDocumentItemCategory AS PurchasingDocumentItemCategory,
P_PurgDocSchedulelineCuml.ScheduleLineOrderQuantity AS ScheduledQuantity,
I_PurchasingDocumentItem.OrderQuantityUnit AS OrderUnit,
P_PurgDocSchedulelineCuml.CummulativeSheduleQuantity AS CummulativeSheduleQuantity,
I_PurchasingDocumentItem.IsCompletelyDelivered AS IsCompletelyDelivered,
I_PurchasingDocumentItem._MaterialGroup AS _MaterialGroup,
ScheduleLineUniqueID,
I_PurchasingDocumentItem._PurchasingDocument.ValidityStartDate AS ValidityStartDate,
I_PurchasingDocumentItem._PurchasingDocument.ValidityEndDate AS ValidityEndDate,
I_PurchasingDocumentItem._PurchasingDocument.TargetAmount AS TargetAmount,
I_PurchasingDocumentItem.RequirementTracking AS RequirementTracking,
I_PurchasingDocumentItem.StorageLocation AS StorageLocation,
I_PurchasingDocumentItem._StorageLocation.StorageLocationName AS StorageLocationName,
I_PurchasingDocumentItem._PurchasingDocument.PurchasingProcessingStatus AS PurchasingProcessingStatus,
I_PurchasingDocumentItem._PurgDocumentItemCategory AS _PurgDocumentItemCategory,
I_PurchasingDocumentItem._PurchasingDocument.CreationDate AS CreationDate,
I_PurchasingDocumentItem.TargetQuantity AS TargetQuantity,
I_PurchasingDocumentItem.GoodsReceiptIsExpected AS GoodsReceiptIsExpected,
case when I_SupplierConfirmationControl.SupplierConfDueDateType = '1' then cast(dats_add_days(I_PurchasingDocumentItem._PurchasingDocument.PurchasingDocumentOrderDate, cast(I_SupplierConfirmationControl.SupplierConfDuePeriodInDays as abap.int4),'FAIL') as abap.dats) when I_SupplierConfirmationControl.SupplierConfDueDateType = '2' then cast(dats_add_days(P_PurgDocSchedulelineCuml.ScheduleLineDeliveryDate,-cast(I_SupplierConfirmationControl.SupplierConfDuePeriodInDays as abap.int4),'FAIL') as abap.dats) else cast('00000000' as abap.dats) end as KeyDate AS datsendasKeyDate
FROM P_PurgDocSchedulelineCuml
INNER JOIN I_PurchasingDocumentItem ON /* join condition not captured in parsed metadata */
INNER JOIN I_SupplierConfirmationControl ON /* join condition not captured in parsed metadata */
;