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_GRIRAccountRecncln3.
-- 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.
CREATE VIEW P_GRIRAccountRecncln3 AS
SELECT
P_GRIRAccountRecncln2.CompanyCode AS CompanyCode,
P_GRIRAccountRecncln2.PurchasingDocument AS PurchasingDocument,
P_GRIRAccountRecncln2.PurchasingDocumentItem AS PurchasingDocumentItem,
P_GRIRAccountRecncln2.ValuationArea AS ValuationArea,
cast(P_GRIRAccountRecncln2.ReferenceQuantityUnit as fis_ref_qty_uom_ui5 preserving type ) AS ReferenceQuantityUnit,
P_GRIRAccountRecncln2.CompanyCodeCurrency AS CompanyCodeCurrency,
cast(P_GRIRAccountRecncln2.AmountInCompanyCodeCurrency as fis_hsl preserving type ) AS AmountInCompanyCodeCurrency,
cast(P_GRIRAccountRecncln2.BalanceAbsoluteAmtInCoCodeCrcy as fis_abs_bal_dmbtr preserving type) AS BalanceAbsoluteAmtInCoCodeCrcy,
cast(P_GRIRAccountRecncln2.GoodsReceiptGoodsAmtInCCCrcy as fis_grir_gr_goods_hsl preserving type) AS GoodsReceiptGoodsAmtInCCCrcy,
cast(P_GRIRAccountRecncln2.GdsRcptDelivCostAmtInCCCrcy as fis_grir_gr_freight_hsl preserving type) AS GdsRcptDelivCostAmtInCCCrcy,
cast(P_GRIRAccountRecncln2.InvoiceRcptGoodsAmtInCCCrcy as fis_grir_ir_goods_hsl preserving type) AS InvoiceRcptGoodsAmtInCCCrcy,
cast(P_GRIRAccountRecncln2.InvcRcptDelivCostAmtInCCCrcy as fis_grir_ir_freight_hsl preserving type) AS InvcRcptDelivCostAmtInCCCrcy,
cast(P_GRIRAccountRecncln2.DeliveryCostBalAmtInCCCrcy as fis_grir_freight_bal_hsl preserving type) AS DeliveryCostBalAmtInCCCrcy,
cast(P_GRIRAccountRecncln2.GoodsBalanceAmountInCCCrcy as fis_grir_goods_bal_hsl preserving type) AS GoodsBalanceAmountInCCCrcy,
cast(P_GRIRAccountRecncln2.GoodsReceiptAmountInCoCodeCrcy as fis_grir_gr_hsl preserving type) AS GoodsReceiptAmountInCoCodeCrcy,
cast(P_GRIRAccountRecncln2.InvoiceRcptAmtInCoCodeCrcy as fis_grir_ir_hsl preserving type) AS InvoiceRcptAmtInCoCodeCrcy,
cast(P_GRIRAccountRecncln2.BaseUnit as meins preserving type ) AS BaseUnit,
cast(P_GRIRAccountRecncln2.Quantity as fis_grir_bal_qty preserving type) AS Quantity,
cast(P_GRIRAccountRecncln2.BalanceAbsoluteQuantity as fis_abs_bal_quantity preserving type) AS BalanceAbsoluteQuantity,
cast(P_GRIRAccountRecncln2.GoodsReceiptDeliveryCostQty as fis_grir_gr_freight_qty preserving type) AS GoodsReceiptDeliveryCostQty,
cast(P_GRIRAccountRecncln2.GoodsReceiptGoodsQuantity as fis_grir_gr_qty preserving type ) AS GoodsReceiptGoodsQuantity,
cast(P_GRIRAccountRecncln2.InvoiceReceiptGoodsQuantity as fis_grir_ir_qty preserving type ) AS InvoiceReceiptGoodsQuantity,
cast(P_GRIRAccountRecncln2.InvoiceRcptDeliveryCostQty as fis_grir_ir_freight_qty preserving type ) AS InvoiceRcptDeliveryCostQty,
cast(P_GRIRAccountRecncln2.GoodsBalanceQuantity as fis_grir_goods_bal_qty preserving type ) AS GoodsBalanceQuantity,
cast(P_GRIRAccountRecncln2.DeliveryCostBalanceQuantity as fis_grir_freight_bal_qty preserving type ) AS DeliveryCostBalanceQuantity,
cast(P_GRIRAccountRecncln2.GoodsReceiptQty as fis_grir_gr_qty preserving type ) AS GoodsReceiptQty,
cast(P_GRIRAccountRecncln2.InvoiceReceiptQty as fis_grir_ir_qty preserving type ) AS InvoiceReceiptQty,
P_GRIRAccountRecncln2.ReferenceQuantity AS ReferenceQuantity,
P_GRIRAccountRecncln2.BalanceAbsoluteQtyInRefQtyUnit AS BalanceAbsoluteQtyInRefQtyUnit,
P_GRIRAccountRecncln2.GRDelivCostQtyInRefQtyUnit AS GRDelivCostQtyInRefQtyUnit,
P_GRIRAccountRecncln2.GoodsReceiptGdsQtyInRefQtyUnit AS GoodsReceiptGdsQtyInRefQtyUnit,
P_GRIRAccountRecncln2.InvoiceRcptGdsQtyInRefQtyUnit AS InvoiceRcptGdsQtyInRefQtyUnit,
P_GRIRAccountRecncln2.InvcRcptDelivQtyInRefQtyUnit AS InvcRcptDelivQtyInRefQtyUnit,
P_GRIRAccountRecncln2.GdsBalanceQuantityInRefQtyUnit AS GdsBalanceQuantityInRefQtyUnit,
P_GRIRAccountRecncln2.DelivCostBalQtyInRefQtyUnit AS DelivCostBalQtyInRefQtyUnit,
P_GRIRAccountRecncln2.GoodsReceiptQtyInRefQtyUnit AS GoodsReceiptQtyInRefQtyUnit,
P_GRIRAccountRecncln2.InvoiceReceiptQtyInRefQtyUnit AS InvoiceReceiptQtyInRefQtyUnit,
cast(P_GRIRAccountRecncln2.OldestOpenItemPostingDate as fis_grir_oldestopnitmpostgdate preserving type ) AS OldestOpenItemPostingDate,
cast(P_GRIRAccountRecncln2.LatestOpenItemPostingDate as fis_latest_budat preserving type) AS LatestOpenItemPostingDate,
P_GRIRAccountRecncln2.NumberOfGoodsReceipts AS NumberOfGoodsReceipts,
P_GRIRAccountRecncln2.NumberOfInvoiceReceipts AS NumberOfInvoiceReceipts,
P_GRIRAccountRecncln2.NumberOfOpenItems AS NumberOfOpenItems,
cast(P_GRIRAccountRecncln2.Quantity as fis_grir_bal_qty preserving type) AS BalanceQuantity,
cast(P_GRIRAccountRecncln2.ReferenceQuantity as fis_grir_bal_qty_rrunit preserving type) AS BalanceQuantityInRefQtyUnit,
_PurchasingDocumentItem.OrderQuantityUnit AS PurgDocOrderQuantityUnit,
_PurchasingDocumentItem.OrderQuantity AS OrderQuantity,
_PurchasingDocumentItem.Plant AS Plant,
cast(_PurchasingDocument.PurchasingOrganization as fis_grir_ekorg preserving type ) AS PurchasingOrganization,
cast(_PurchasingDocument.PurchasingGroup as fis_grir_ekgrp preserving type ) AS PurchasingGroup,
_PurchasingDocumentItem.MaterialGroup AS MaterialGroup,
_PurchasingDocumentItem.Material AS Material,
_PurchasingDocumentItem.RequisitionerName AS RequisitionerName,
_PurchasingDocumentItem.AccountAssignmentCategory AS AccountAssignmentCategory,
_PurchasingDocumentItem.IsFinallyInvoiced AS IsFinallyInvoiced,
_PurchasingDocumentItem.PurchasingDocumentDeletionCode AS PurchasingDocumentDeletionCode,
_PurchasingDocument.Supplier AS Supplier,
_PurchasingDocument._Supplier.SupplierName AS SupplierName,
_PurchasingDocument.CreatedByUser AS CreatedByUser,
cast( _PurchasingDocumentItem.PurchasingDocumentItemUniqueID as txz01) AS PurchasingDocumentItemText,
_PurchasingDocumentItem.PurchasingDocumentItemUniqueID AS PurchasingDocumentItemUniqueID,
_PurchasingDocumentItem.ValuationType AS ValuationType,
cast(_PurchasingDocumentItem.PurchasingDocumentItemCategory as fis_pstyp preserving type ) AS PurchasingDocumentItemCategory,
_PurchasingDocument.PurchasingDocumentCategory AS PurchasingDocumentCategory,
_PurchasingDocument.InvoicingParty AS InvoicingParty,
_PurchasingDocument._InvoicingParty.SupplierName AS InvoicingPartyName,
_PurchasingDocument.PurchasingDocumentType AS PurchasingDocumentType,
cast( 1 as fis_grir_no_po_items ) AS NumberOfPurchaseOrderItems,
P_GRIRAccountRecncln2._CompanyCode AS _CompanyCode,
P_GRIRAccountRecncln2._CompanyCodeCurrency AS _CompanyCodeCurrency,
_PurchasingDocumentItem._MaterialGroup AS _MaterialGroup,
_PurchasingDocumentItem._Material AS _Material,
_PurchasingDocumentItem._Plant AS _Plant,
_PurchasingDocument._Supplier AS _Supplier,
_PurchasingDocument._InvoicingParty AS _InvoicingParty,
_PurchasingDocument._PurchasingDocumentType AS _PurchasingDocumentType,
_PurchasingDocument._PurchasingOrganization AS _PurchasingOrganization,
_PurchasingDocument._PurchasingGroup AS _PurchasingGroup
FROM P_GRIRAccountRecncln2
LEFT OUTER JOIN I_UnitOfMeasure AS _PurgDocOrderQuantityUnit ON PurgDocOrderQuantityUnit = _PurgDocOrderQuantityUnit.UnitOfMeasure -- association [0..1]
LEFT OUTER JOIN I_UnitOfMeasure AS _BaseUnit ON BaseUnit = _BaseUnit.UnitOfMeasure -- association [0..1]
LEFT OUTER JOIN I_UnitOfMeasure AS _ReferenceQuantityUnit ON ReferenceQuantityUnit = _ReferenceQuantityUnit.UnitOfMeasure -- association [0..1]
;