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 I_GLAcctLineItemEnrcd.
-- 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: IGLACCTLINEITEME
-- Parameters: P_CompanyCode : bukrs, P_FiscalYear : gjahr, P_CurrencyRole : fac_crcyrole
CREATE VIEW I_GLAcctLineItemEnrcd AS
SELECT
lineitem.CompanyCode AS CompanyCode,
lineitem.FiscalYear AS FiscalYear,
lineitem.AccountingDocument AS AccountingDocument,
lineitem.LedgerGLLineItem AS LedgerGLLineItem,
lineitem.Ledger AS Ledger,
lineitem.FiscalPeriod AS FiscalPeriod,
lineitem.PostingDate AS PostingDate,
lineitem.GLAccount AS GLAccount,
AlternativeGLAccount,
lineitem.Supplier AS Supplier,
lineitem.Customer AS Customer,
lineitem.SpecialGLCode AS SpecialGLCode,
lineitem.ProfitCenter AS ProfitCenter,
lineitem.Segment AS Segment,
lineitem.BusinessArea AS BusinessArea,
lineitem.AssignmentReference AS AssignmentReference,
IsCleared,
lineitem.DebitCreditCode AS DebitCreditCode,
lineitem.SalesOrganization AS SalesOrganization,
lineitem.DistributionChannel AS DistributionChannel,
lineitem.OrganizationDivision AS OrganizationDivision,
lineitem.PartnerProfitCenter AS PartnerProfitCenter,
lineitem.FinancialAccountType AS FinancialAccountType,
lineitem.AccountingDocumentType AS AccountingDocumentType,
lineitem.DocumentDate AS DocumentDate,
lineitem.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
lineitem.DocumentItemText AS DocumentItemText,
lineitem.ClearingDate AS ClearingDate,
lineitem.ClearingJournalEntry AS ClearingJournalEntry,
cast( lineitem.AlternativeReferenceDocument as fis_xblnr_alt_wo_exit ) AS AlternativeReferenceDocument,
AccountingDocumentHeaderText,
case :P_CurrencyRole when currency.CompanyCodeCurrencyRole then case when lineitem.CompanyCodeCurrency = '' then currency.CompanyCodeCurrency else lineitem.CompanyCodeCurrency end when currency.GlobalCurrencyRole then case when lineitem.GlobalCurrency = '' then currency.GlobalCurrency else lineitem.GlobalCurrency end when currency.FreeDefinedCurrency1Role then case when lineitem.FreeDefinedCurrency1 = '' then currency.FreeDefinedCurrency1 else lineitem.FreeDefinedCurrency1 end when currency.FreeDefinedCurrency2Role then case when lineitem.FreeDefinedCurrency2 = '' then currency.FreeDefinedCurrency2 else lineitem.FreeDefinedCurrency2 end when currency.FreeDefinedCurrency3Role then case when lineitem.FreeDefinedCurrency3 = '' then currency.FreeDefinedCurrency3 else lineitem.FreeDefinedCurrency3 end when currency.FreeDefinedCurrency4Role then case when lineitem.FreeDefinedCurrency4 = '' then currency.FreeDefinedCurrency4 else lineitem.FreeDefinedCurrency4 end when currency.FreeDefinedCurrency5Role then case when lineitem.FreeDefinedCurrency5 = '' then currency.FreeDefinedCurrency5 else lineitem.FreeDefinedCurrency5 end when currency.FreeDefinedCurrency6Role then case when lineitem.FreeDefinedCurrency6 = '' then currency.FreeDefinedCurrency6 else lineitem.FreeDefinedCurrency6 end when currency.FreeDefinedCurrency7Role then case when lineitem.FreeDefinedCurrency7 = '' then currency.FreeDefinedCurrency7 else lineitem.FreeDefinedCurrency7 end when currency.FreeDefinedCurrency8Role then case when lineitem.FreeDefinedCurrency8 = '' then currency.FreeDefinedCurrency8 else lineitem.FreeDefinedCurrency8 end else lineitem.CompanyCodeCurrency end as DisplayCurrency AS CompanyCodeCurrencyendasDisplayCurrency,
lineitem.TransactionCurrency AS TransactionCurrency,
lineitem.AmountInTransactionCurrency AS AmountInTransactionCurrency,
lineitem.DebitAmountInTransCrcy AS DebitAmountInTransCrcy,
lineitem.CreditAmountInTransCrcy AS CreditAmountInTransCrcy,
case :P_CurrencyRole when currency.CompanyCodeCurrencyRole then lineitem.AmountInCompanyCodeCurrency when currency.GlobalCurrencyRole then lineitem.AmountInGlobalCurrency when currency.FreeDefinedCurrency1Role then lineitem.AmountInFreeDefinedCurrency1 when currency.FreeDefinedCurrency2Role then lineitem.AmountInFreeDefinedCurrency2 when currency.FreeDefinedCurrency3Role then lineitem.AmountInFreeDefinedCurrency3 when currency.FreeDefinedCurrency4Role then lineitem.AmountInFreeDefinedCurrency4 when currency.FreeDefinedCurrency5Role then lineitem.AmountInFreeDefinedCurrency5 when currency.FreeDefinedCurrency6Role then lineitem.AmountInFreeDefinedCurrency6 when currency.FreeDefinedCurrency7Role then lineitem.AmountInFreeDefinedCurrency7 when currency.FreeDefinedCurrency8Role then lineitem.AmountInFreeDefinedCurrency8 else cast ( 0 as abap.curr(23,2) ) end as AmountInDisplayCurrency AS curr232endasAmountInDisplayCurrency,
case :P_CurrencyRole when currency.CompanyCodeCurrencyRole then lineitem.DebitAmountInCoCodeCrcy when currency.GlobalCurrencyRole then lineitem.DebitAmountInGlobalCrcy when currency.FreeDefinedCurrency1Role then lineitem.DebitAmountInFreeDefinedCrcy1 when currency.FreeDefinedCurrency2Role then lineitem.DebitAmountInFreeDefinedCrcy2 when currency.FreeDefinedCurrency3Role then lineitem.DebitAmountInFreeDefinedCrcy3 when currency.FreeDefinedCurrency4Role then lineitem.DebitAmountInFreeDefinedCrcy4 when currency.FreeDefinedCurrency5Role then lineitem.DebitAmountInFreeDefinedCrcy5 when currency.FreeDefinedCurrency6Role then lineitem.DebitAmountInFreeDefinedCrcy6 when currency.FreeDefinedCurrency7Role then lineitem.DebitAmountInFreeDefinedCrcy7 when currency.FreeDefinedCurrency8Role then lineitem.DebitAmountInFreeDefinedCrcy8 else cast ( 0 as abap.curr(23,2) ) end as DebitAmountInDisplayCrcy AS curr232endasDebitAmountInDisplayCrcy,
case :P_CurrencyRole when currency.CompanyCodeCurrencyRole then lineitem.CreditAmountInCoCodeCrcy when currency.GlobalCurrencyRole then lineitem.CreditAmountInGlobalCrcy when currency.FreeDefinedCurrency1Role then lineitem.CreditAmountInFreeDefinedCrcy1 when currency.FreeDefinedCurrency2Role then lineitem.CreditAmountInFreeDefinedCrcy2 when currency.FreeDefinedCurrency3Role then lineitem.CreditAmountInFreeDefinedCrcy3 when currency.FreeDefinedCurrency4Role then lineitem.CreditAmountInFreeDefinedCrcy4 when currency.FreeDefinedCurrency5Role then lineitem.CreditAmountInFreeDefinedCrcy5 when currency.FreeDefinedCurrency6Role then lineitem.CreditAmountInFreeDefinedCrcy6 when currency.FreeDefinedCurrency7Role then lineitem.CreditAmountInFreeDefinedCrcy7 when currency.FreeDefinedCurrency8Role then lineitem.CreditAmountInFreeDefinedCrcy8 else cast ( 0 as abap.curr(23,2) ) end as CreditAmountInDisplayCrcy AS curr232endasCreditAmountInDisplayCrcy,
lineitem._Customer AS _Customer,
lineitem._Supplier AS _Supplier
FROM P_GLAcctLineItemEnrcd
LEFT OUTER JOIN I_LedgerCompanyCodeCrcyRoleVH AS currency ON lineitem.CompanyCode = currency.CompanyCode AND lineitem.Ledger = currency.Ledger -- association [0..1]
;