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_PubSecCmtmtAgingLabel.
-- 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: IPSCMTAGINGLABEL
-- Parameters: P_CurrentDate : sydats, P_PubSecOpnCmtmtTme1 : psm_open_cmtmt_param_days, P_PubSecOpnCmtmtTme2 : psm_open_cmtmt_param_slice
CREATE VIEW I_PubSecCmtmtAgingLabel AS
SELECT
Item.Ledger AS Ledger,
Item.CompanyCode AS CompanyCode,
Item.FiscalYear AS FiscalYear,
Item.AccountingDocument AS AccountingDocument,
Item.LedgerGLLineItem AS LedgerGLLineItem,
Item.FinancialManagementArea AS FinancialManagementArea,
Item.ControllingArea AS ControllingArea,
Item.Fund AS Fund,
Item.FundType AS FundType,
Item.GLAccount AS GLAccount,
Item.CostCenter AS CostCenter,
Item.ProfitCenter AS ProfitCenter,
Item.FunctionalArea AS FunctionalArea,
Item.GrantID AS GrantID,
Item.SponsoredClass AS SponsoredClass,
Item.SponsoredProgram AS SponsoredProgram,
Item.PubSecBudgetAccountCoCode AS PubSecBudgetAccountCoCode,
Item.PubSecBudgetAccount AS PubSecBudgetAccount,
Item.PubSecBudgetCnsmpnType AS PubSecBudgetCnsmpnType,
Item.PubSecBdgtAcctRevnExpnCode AS PubSecBdgtAcctRevnExpnCode,
Item.PubSecOpnCmtmtDays AS PubSecOpnCmtmtDays,
Item.Segment AS Segment,
Item.WBSElementInternalID AS WBSElementInternalID,
Item.WBSElementExternalID AS WBSElementExternalID,
Item.BudgetPeriod AS BudgetPeriod,
Item.SourceReferenceDocumentType AS SourceReferenceDocumentType,
Item.SourceReferenceDocument AS SourceReferenceDocument,
Item.SourceReferenceDocumentItem AS SourceReferenceDocumentItem,
Item.SourceLogicalSystem AS SourceLogicalSystem,
Item.SourceReferenceDocumentCntxt AS SourceReferenceDocumentCntxt,
Item.SourceReferenceDocSubitem AS SourceReferenceDocSubitem,
Item.ChartOfAccounts AS ChartOfAccounts,
Item.PurchasingDocument AS PurchasingDocument,
Item.PurchasingDocumentItem AS PurchasingDocumentItem,
Item.AccountAssignmentNumber AS AccountAssignmentNumber,
Item.PubSecOpenCmtmtAgingDate AS PubSecOpenCmtmtAgingDate,
Item.TransactionCurrency AS TransactionCurrency,
Item.PubSecOpnCmtmtAmtInTransCrcy AS PubSecOpnCmtmtAmtInTransCrcy,
Item.CompanyCodeCurrency AS CompanyCodeCurrency,
Item.PubSecOpnCmtmtAmtInCoCodeCrcy AS PubSecOpnCmtmtAmtInCoCodeCrcy,
Item.GlobalCurrency AS GlobalCurrency,
Item.PubSecOpnCmtmtAmtInGlobCrcy AS PubSecOpnCmtmtAmtInGlobCrcy,
Item._CompanyCode AS _CompanyCode,
Item._Fund AS _Fund,
Item._FundType AS _FundType,
Item._TransactionCurrency AS _TransactionCurrency,
Item._CompanyCodeCurrency AS _CompanyCodeCurrency,
Item._GlobalCurrency AS _GlobalCurrency,
Item._FiscalYear AS _FiscalYear,
Item._FinancialManagementArea AS _FinancialManagementArea,
Item._CostCenter AS _CostCenter,
Item._CurrentCostCenter AS _CurrentCostCenter,
Item._GLAccountInChartOfAccounts AS _GLAccountInChartOfAccounts,
Item._GLAccountInCompanyCode AS _GLAccountInCompanyCode,
Item._BudgetPeriod AS _BudgetPeriod,
Item._FunctionalArea AS _FunctionalArea,
Item._Grant AS _Grant,
Item._ProfitCenter AS _ProfitCenter,
Item._CurrentProfitCenter AS _CurrentProfitCenter,
Item._SourceReferenceDocumentType AS _SourceReferenceDocumentType,
Item._Segment AS _Segment,
Item._PubSecBdgtCnsmpnType AS _PubSecBdgtCnsmpnType,
Item._PubSecBudgetAccount AS _PubSecBudgetAccount,
Item._PubSecBdgtAcctRevnExpnCode AS _PubSecBdgtAcctRevnExpnCode,
Item._WBSElementBasicData AS _WBSElementBasicData,
Item._WBSElementExternalID AS _WBSElementExternalID,
Item.PubSecOpnCmtmtTme1 AS PubSecOpnCmtmtTme1,
Item.PubSecOpnCmtmtTme2 AS PubSecOpnCmtmtTme2,
Item.PubSecOpnCmtmtTme3 AS PubSecOpnCmtmtTme3,
Item.PubSecOpnCmtmtTme4 AS PubSecOpnCmtmtTme4,
Item.PubSecOpnCmtmtTme5 AS PubSecOpnCmtmtTme5,
Item.ReferencePurchaseOrderCategory AS ReferencePurchaseOrderCategory,
case when PubSecOpnCmtmtDays >= :P_PubSecOpnCmtmtTme1 and PubSecOpnCmtmtDays <= PubSecOpnCmtmtTme1 then cast(concat_with_space('A', concat_with_space(cast(:P_PubSecOpnCmtmtTme1 as abap.char(20)), concat_with_space('-', cast(PubSecOpnCmtmtTme1 as abap.char(20)), 1), 1), 1) as psm_open_cmtmt_time_intvl) when PubSecOpnCmtmtDays > PubSecOpnCmtmtTme1 and PubSecOpnCmtmtDays <= PubSecOpnCmtmtTme2 then cast(concat_with_space('B', concat_with_space(cast(PubSecOpnCmtmtTme1 as abap.char(20)), concat_with_space('-', cast(PubSecOpnCmtmtTme2 as abap.char(20)), 1), 1), 1) as psm_open_cmtmt_time_intvl) when PubSecOpnCmtmtDays > PubSecOpnCmtmtTme2 and PubSecOpnCmtmtDays <= PubSecOpnCmtmtTme3 then cast(concat_with_space('C', concat_with_space(cast(PubSecOpnCmtmtTme2 as abap.char(20)), concat_with_space('-', cast(PubSecOpnCmtmtTme3 as abap.char(20)), 1), 1), 1) as psm_open_cmtmt_time_intvl) when PubSecOpnCmtmtDays > PubSecOpnCmtmtTme3 and PubSecOpnCmtmtDays <= PubSecOpnCmtmtTme4 then cast(concat_with_space('D', concat_with_space(cast(PubSecOpnCmtmtTme3 as abap.char(20)), concat_with_space('-', cast(PubSecOpnCmtmtTme4 as abap.char(20)), 1), 1), 1) as psm_open_cmtmt_time_intvl) when PubSecOpnCmtmtDays > PubSecOpnCmtmtTme4 then cast(concat_with_space('E', concat_with_space('>', cast(PubSecOpnCmtmtTme4 as abap.char(20)), 1), 1) as psm_open_cmtmt_time_intvl) else cast('-' as abap.char(1)) end as PubSecOpnCmtmtTmeIntvl AS char1endasPubSecOpnCmtmtTmeIntvl,
case when PubSecOpnCmtmtDays >= :P_PubSecOpnCmtmtTme1 and PubSecOpnCmtmtDays <= PubSecOpnCmtmtTme1 then cast(Item.PubSecOpnCmtmtAmtInGlobCrcy as psm_open_cmtmt_amt_gc_1) else cast(0 as abap.curr( 23, 2 )) end as PubSecOpnCmtmtAmtInGlobCrcy1 AS curr232endasPubSecOpnCmtmtAmtInGlobCrcy1,
case when PubSecOpnCmtmtDays > PubSecOpnCmtmtTme1 and PubSecOpnCmtmtDays <= PubSecOpnCmtmtTme2 then cast(Item.PubSecOpnCmtmtAmtInGlobCrcy as psm_open_cmtmt_amt_gc_2) else cast(0 as abap.curr( 23, 2 )) end as PubSecOpnCmtmtAmtInGlobCrcy2 AS curr232endasPubSecOpnCmtmtAmtInGlobCrcy2,
case when PubSecOpnCmtmtDays > PubSecOpnCmtmtTme2 and PubSecOpnCmtmtDays <= PubSecOpnCmtmtTme3 then cast(Item.PubSecOpnCmtmtAmtInGlobCrcy as psm_open_cmtmt_amt_gc_3) else cast(0 as abap.curr( 23, 2 )) end as PubSecOpnCmtmtAmtInGlobCrcy3 AS curr232endasPubSecOpnCmtmtAmtInGlobCrcy3,
case when PubSecOpnCmtmtDays > PubSecOpnCmtmtTme3 and PubSecOpnCmtmtDays <= PubSecOpnCmtmtTme4 then cast(Item.PubSecOpnCmtmtAmtInGlobCrcy as psm_open_cmtmt_amt_gc_4) else cast(0 as abap.curr( 23, 2 )) end as PubSecOpnCmtmtAmtInGlobCrcy4 AS curr232endasPubSecOpnCmtmtAmtInGlobCrcy4,
case when PubSecOpnCmtmtDays > PubSecOpnCmtmtTme4 then cast(Item.PubSecOpnCmtmtAmtInGlobCrcy as psm_open_cmtmt_amt_gc_5) else cast(0 as abap.curr( 23, 2 )) end as PubSecOpnCmtmtAmtInGlobCrcy5 AS curr232endasPubSecOpnCmtmtAmtInGlobCrcy5
FROM I_PubSecCmtmtAgingGroup
;