@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'PREPFINDRT_03'
@AbapCatalog.compiler.compareFilter: true
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private:true
@ClientHandling.algorithm: #SESSION_VARIABLE
//@AccessControl.authorizationCheck: #NOT_ALLOWED
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.sizeCategory: #XL
@AccessControl.personalData.blocking: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
define view P_ReportedFinancialData_RT_03
with parameters
p_timestamp_from :timestamp,
p_timestamp_to :timestamp
as select from P_ReportedFinancialData_RT_02
(p_timestamp_from : :p_timestamp_from,
p_timestamp_to : :p_timestamp_to)
left outer to one join P_ConsolidationUnitCurrency on P_ReportedFinancialData_RT_02.rdimen = dimen
and P_ReportedFinancialData_RT_02.rbunit = bunit
and P_ReportedFinancialData_RT_02.ryear = CalendarYear
// begin of bbrCC1808: Use new FS item mapping
////// // T004: Get group chart of accounts (KKTPL) for local chart of accounts (KTOPL)
////// // inner join t004 t004 on P_ReportedFinancialData_RT_02.ktopl = t004.ktopl
////// left outer to one join I_ChartOfAccounts on P_ReportedFinancialData_RT_02.ktopl = I_ChartOfAccounts.ChartOfAccounts
//////
////// // SKA1: G/L Account Master Data
////// // inner join ska1 ska1 on P_ReportedFinancialData_RT_02.ktopl = ska1.ktopl
////// // and P_ReportedFinancialData_RT_02.racct = ska1.saknr
////// left outer to one join I_GLAccountInChartOfAccounts on P_ReportedFinancialData_RT_02.ktopl = I_GLAccountInChartOfAccounts.ChartOfAccounts
////// and P_ReportedFinancialData_RT_02.racct = I_GLAccountInChartOfAccounts.GLAccount
left outer join I_FSItemMappingAssgmtWithVers on P_ReportedFinancialData_RT_02.impvs = FSItemMappingVersion
and P_ReportedFinancialData_RT_02.fiscal_year_period between ValidityStartFiscalYearPeriod and ValidityEndFiscalYearPeriod
and P_ReportedFinancialData_RT_02.ktopl = ChartOfAccounts
and P_ReportedFinancialData_RT_02.racct = GLAccount
// &NORELEASE is a dummy FS item, G/L accounts with this target must be ignored
and FinancialStatementItem <> '&NORELEASE' //bbr n2843448
// end of bbrCC1808
left outer to one join tfin010 on P_ReportedFinancialData_RT_02.rdimen = tfin010.dimen
and P_ReportedFinancialData_RT_02.rassc = tfin010.rcomp
and tfin010.contp = '1'
and tfin010.rcomp <> '' //bbr n3265126
{
//RITEM
//begin of bbrCC1808
////// case
////// when I_ChartOfAccounts.CorporateGroupChartOfAccounts = ''
////// or I_ChartOfAccounts.CorporateGroupChartOfAccounts = P_ReportedFinancialData_RT_02.ktopl
////// // Group chart of accounts = Local chart of accounts
////// // -> item = G/L account
////// then P_ReportedFinancialData_RT_02.racct
////// // else
////// when I_ChartOfAccounts.CorporateGroupChartOfAccounts <> ''
////// and I_ChartOfAccounts.CorporateGroupChartOfAccounts <> P_ReportedFinancialData_RT_02.ktopl
////// // Group chart of accounts <> Local chart of accounts
////// // -> item = Group account (BILKT) of G/L account
////// then I_GLAccountInChartOfAccounts.CorporateGroupAccount
////// // Evaluation of ranges if specified in TFIN200 not necessary:
////// // Only for secondary cost elements, not available in S/4
////// end as ritem,
I_FSItemMappingAssgmtWithVers.FinancialStatementItem as ritem,
//'' as ritem,
I_FSItemMappingAssgmtWithVers.ConsolidationChartOfAccounts,
//end of bbrCC1808
coalesce(tfin010.bunit,'') as rbuptr, //gew2781691
P_ReportedFinancialData_RT_02.gcurr as rgcurr,
P_ConsolidationUnitCurrency.curr as rlcurr,
P_ConsolidationUnitCurrency.curr_local_send,
// tgsb.gsber_kons as sitem_gsber,
P_ReportedFinancialData_RT_02.rdimen,
P_ReportedFinancialData_RT_02.rldnr_fin,
P_ReportedFinancialData_RT_02.docln_fin,
P_ReportedFinancialData_RT_02.robukrs,
P_ReportedFinancialData_RT_02.rassc,
P_ReportedFinancialData_RT_02.rvers,
P_ReportedFinancialData_RT_02.rbunit,
P_ReportedFinancialData_RT_02.budat,
P_ReportedFinancialData_RT_02.belnr,
P_ReportedFinancialData_RT_02.docln,
P_ReportedFinancialData_RT_02.sbusa,
P_ReportedFinancialData_RT_02.rldnr,
P_ReportedFinancialData_RT_02.rtcur,
P_ReportedFinancialData_RT_02.runit,
P_ReportedFinancialData_RT_02.poper,
P_ReportedFinancialData_RT_02.ryear,
P_ReportedFinancialData_RT_02.fiscal_year_period, //bbrCC1908
P_ReportedFinancialData_RT_02.rmvct,
P_ReportedFinancialData_RT_02.rfarea,
P_ReportedFinancialData_RT_02.rcntr,
P_ReportedFinancialData_RT_02.prctr,
P_ReportedFinancialData_RT_02.rbusa,
P_ReportedFinancialData_RT_02.blart,
P_ReportedFinancialData_RT_02.gjahr,
P_ReportedFinancialData_RT_02.racct,
P_ReportedFinancialData_RT_02.tsl,
P_ReportedFinancialData_RT_02.hsl,
P_ReportedFinancialData_RT_02.ksl,
P_ReportedFinancialData_RT_02.osl,
P_ReportedFinancialData_RT_02.vsl,
P_ReportedFinancialData_RT_02.bsl,
P_ReportedFinancialData_RT_02.csl,
P_ReportedFinancialData_RT_02.dsl,
P_ReportedFinancialData_RT_02.esl,
P_ReportedFinancialData_RT_02.fsl,
P_ReportedFinancialData_RT_02.gsl,
P_ReportedFinancialData_RT_02.msl,
P_ReportedFinancialData_RT_02.activ,
P_ReportedFinancialData_RT_02.refdocnr,
P_ReportedFinancialData_RT_02.refryear,
P_ReportedFinancialData_RT_02.refactiv,
P_ReportedFinancialData_RT_02.usnam,
P_ReportedFinancialData_RT_02.awtyp,
P_ReportedFinancialData_RT_02.aworg,
P_ReportedFinancialData_RT_02.logsys,
P_ReportedFinancialData_RT_02.curr_group_send,
P_ReportedFinancialData_RT_02.gcurr,
P_ReportedFinancialData_RT_02.Segment
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_FSITEMMAPPINGASSGMTWITHVERS",
"P_CONSOLIDATIONUNITCURRENCY",
"P_REPORTEDFINANCIALDATA_RT_02",
"TFIN010"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/