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_DMVCGLAccLineItemMaterial.-- 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: PDMVCGLACCMATL-- Parameters: P_DateFrom : calendardate, P_DateTo : calendardate, P_CurrencyType : curtp, P_Ledger : rldnrCREATE VIEW P_DMVCGLAccLineItemMaterial ASSELECTcasewhen _ConsumptionAlternative.CostEstimate isnot initial and (_ProcessCategory.flg_mstuf isnullor _ProcessCategory.flg_mstuf is initial) then _ConsumptionAlternative.CostEstimate else _MaterialLedgerDocument.ProductionProcess endas Process AS ProductionProcessendasProcess,
_MaterialLedgerDocument.ProcessCategory AS ProcessCategory,
_MaterialLedgerDocument.CostEstimate AS CostEstimate,
_MLMaterialHeader.Material AS Material,
casewhen _ProcurementAlternative.ProcurementAlternative isnotnullthen _ProcurementAlternative.Plant when _ProcurementAlternative.ProcurementProcess isnotnulland (_ProcurementAlternative.ProcessCategory = 'VF' or _ProcurementAlternative.ProcessCategory = 'BF') and _ProcurementAlternative.ProductionPlant isnotnulland _ProcurementAlternative.ProductionPlant isnot initial then _ProcurementAlternative.ProductionPlant when _ProcurementAlternative.ProcurementProcess isnotnulland (_ProcurementAlternative.ProcessCategory = 'VF' or _ProcurementAlternative.ProcessCategory = 'BF') and _ProcurementAlternative.Plant isnotnulland _ProcurementAlternative.Plant isnot initial then _ProcurementAlternative.Plant when _ProcurementAlternative.ProcurementProcess isnotnulland (_ProcurementAlternative.ProcessCategory = 'VBK' or _ProcurementAlternative.ProcessCategory = 'BBK') and _ProcurementAlternative.Plant isnotnulland _ProcurementAlternative.Plant isnot initial then _ProcurementAlternative.Plant when _ConsumptionAlternative.CostEstimate isnot initial and (_ProcessCategory.flg_mstuf isnullor _ProcessCategory.flg_mstuf is initial) then _ConsumptionAlternative.Plant when _ProcurementAlternative.ProcurementProcess isnotnulland _ProcurementAlternative.ProcurementProcess isnot initial then _ProcurementAlternative.Plant else '' endas Plant AS PlantelseendasPlant,
casewhen _t001k_001.CompanyCode isnotnullthen _t001k_001.CompanyCode when _t001k_005.CompanyCode isnotnullthen _t001k_005.CompanyCode else ' ' endas CompanyCode AS CompanyCodeelseendasCompanyCode,
_MLMaterialHeader.ValuationArea AS ValuationArea,
_acdoca.awref AS ReferenceDocument,
_acdoca.rldnr AS Ledger,
_acdoca.rbukrs AS SourceCompanyCode,
_acdoca.gjahr AS FiscalYear,
_acdoca.belnr AS AccountingDocument,
_acdoca.docln AS LedgerGLLineItem,
_acdoca.timestampASTimestampLEFTOUTERJOIN P_MLProcessCategory AS _ProcessCategory ON _MaterialLedgerDocument.ProcessCategory = _ProcessCategory.ProcessCategory -- association [0..1]LEFTOUTERJOIN P_MLMaterialHeader AS _MLMaterialHeader ON CostEstimate = _MLMaterialHeader.CostEstimate -- association [0..1]
;