P_RealTimeRptdFinData_01

DDL: P_REALTIMERPTDFINDATA_01 SQL: PREALTIMERFD_01 Type: view COMPOSITE

P_RealTimeRptdFinData_01 is a Composite CDS View in SAP S/4HANA. It reads from 8 data sources and exposes 39 fields.

Data Sources (8)

SourceAliasJoin Type
I_SAPClient _SAPClient inner
I_CnsldtnVersion I_CnsldtnVersion inner
I_CompanyCode I_CompanyCode inner
I_FiscalCalendarDate I_FiscalCalendarDate inner
I_JournalEntryItem Source from
t881 t881 inner
tf165 tf165 inner
tfin010 tfin010 inner

Parameters (2)

NameTypeDefault
P_CreationDateTimeRgFr timestamp
P_CreationDateTimeRgTo timestamp

Annotations (12)

NameValueLevelField
AbapCatalog.preserveKey true view
AbapCatalog.sqlViewName PREALTIMERFD_01 view
AbapCatalog.compiler.compareFilter true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #XL view
AccessControl.personalData.blocking #NOT_REQUIRED view
Metadata.ignorePropagatedAnnotations true view

Fields (39)

KeyFieldSource TableSource FieldDescription
gcurrendasGroupCurrency
ConsolidationDimension tfin010 dimen
ConsolidationUnit tfin010 bunit
ReferenceChartOfAccounts I_CompanyCode ChartOfAccounts
ConsolidationVersion I_CnsldtnVersion ConsolidationVersion
FSItemMappingVersion I_CnsldtnVersion FSItemMappingVersion
CnsldtnUnitGroupCrcySource tf168 curr_group_send
ConsolidationLedger t881 rldnr
FiscalPeriod I_FiscalCalendarDate FiscalPeriod
FiscalYear I_FiscalCalendarDate FiscalYear
FiscalYearPeriod I_FiscalCalendarDate FiscalYearPeriod
PartnerCompany I_JournalEntryItem PartnerCompany
BalanceTransactionCurrency I_JournalEntryItem BalanceTransactionCurrency
BaseUnit I_JournalEntryItem BaseUnit
FinancialTransactionType I_JournalEntryItem FinancialTransactionType
FunctionalArea I_JournalEntryItem FunctionalArea
BusinessArea I_JournalEntryItem BusinessArea
CostCenter I_JournalEntryItem CostCenter
GLAccount I_JournalEntryItem GLAccount
ProfitCenter I_JournalEntryItem ProfitCenter
AmountInTransactionCurrency I_JournalEntryItem AmountInBalanceTransacCrcy
AmountInLocalCurrency I_JournalEntryItem AmountInCompanyCodeCurrency
AmountInGroupCurrency I_JournalEntryItem AmountInGlobalCurrency
QuantityInBaseUnit I_JournalEntryItem Quantity
osl I_JournalEntryItem AmountInFreeDefinedCurrency1
vsl I_JournalEntryItem AmountInFreeDefinedCurrency2
bsl I_JournalEntryItem AmountInFreeDefinedCurrency3
csl I_JournalEntryItem AmountInFreeDefinedCurrency4
dsl I_JournalEntryItem AmountInFreeDefinedCurrency5
esl I_JournalEntryItem AmountInFreeDefinedCurrency6
fsl I_JournalEntryItem AmountInFreeDefinedCurrency7
gsl I_JournalEntryItem AmountInFreeDefinedCurrency8
Segment I_JournalEntryItem Segment
CompanyCode I_JournalEntryItem CompanyCode
SourceLedger I_JournalEntryItem SourceLedger
Ledger I_JournalEntryItem Ledger
LedgerGLLineItem I_JournalEntryItem LedgerGLLineItem
AccountingDocument I_JournalEntryItem AccountingDocument
ReferenceFiscalYear I_JournalEntryItem FiscalYear
@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'PREALTIMERFD_01'
@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_RealTimeRptdFinData_01
  with parameters
    P_CreationDateTimeRgFr :timestamp,
    P_CreationDateTimeRgTo :timestamp
  as select from           I_JournalEntryItem as Source //acdoca


  //  Find all relevant dimen, vers, rldnr.

  //  For one line in acdocp this may result in several lines.


    inner join             I_CompanyCode                    on Source.CompanyCode = I_CompanyCode.CompanyCode

    inner join             tfin010                          on  tfin010.rcomp = I_CompanyCode.Company
                                                            and tfin010.contp = '1'


    inner join             tf165                            on  tfin010.dimen = tf165.dimen
                                                            and tfin010.bunit = tf165.bunit
                                                            and tf165.trans   = 'H'

    inner join             I_SAPClient        as _SAPClient on _SAPClient.sapclient = $session.client

  //                                                                              begin of bbrCC1911

  // ledger dependent customizing for cons. units is optional,

  // cons. units are relevant for all cons. ledgers

    inner join             t881                             on  Source.Ledger = t881.orient_ledger
                                                            and t881.appl     = 'EC'
                                                            and t881.subappl  = 'CS'
  //                                                                                end of bbrCC1911


    left outer to one join tf168                            on  tfin010.dimen = tf168.dimen
                                                            and t881.rldnr    = tf168.rldnr //bbrCC1911

                                                            and tfin010.bunit = tf168.bunit

    inner join             I_CnsldtnVersion                 on  tf165.rvers                           = I_CnsldtnVersion.ConsolidationDataEntryVersion
                                                            and I_CnsldtnVersion.CnsldtnIsPlanVersion = ''

    inner join             I_FiscalCalendarDate             on(
                  tf168.periv                                                                        =  I_FiscalCalendarDate.FiscalYearVariant
                  and Source.PostingDate                                                             =  I_FiscalCalendarDate.CalendarDate
                  and tf168.periv                                                                    <> ''
                  and tf168.periv                                                                    is not null
                )
                                                            or(
                                                              I_CnsldtnVersion.FiscalYearVariant     =  I_FiscalCalendarDate.FiscalYearVariant
                                                              and Source.PostingDate                 =  I_FiscalCalendarDate.CalendarDate
                                                              and(
                                                                tf168.periv                          =  ''
                                                                or tf168.periv                       is null
                                                              )
                                                              and I_CnsldtnVersion.FiscalYearVariant <> ''
                                                            )
                                                            or(
                                                              I_FiscalCalendarDate.FiscalYearVariant =  'K4'
                                                              and Source.PostingDate                 =  I_FiscalCalendarDate.CalendarDate
                                                              and(
                                                                tf168.periv                          =  ''
                                                                or tf168.periv                       is null
                                                              )
                                                              and I_CnsldtnVersion.FiscalYearVariant =  ''
                                                            )
  //                                                                                end of bbrCC1911

{

  // GroupCurrency

  case
  // ledger currency is irrelevant

      when t881.curt2 = '30'
          then _SAPClient.GroupCurrency
  // ledger currency

      else t881.gcurr // use even if initial

  end                                 as GroupCurrency,

  tfin010.dimen                       as ConsolidationDimension,
  tfin010.bunit                       as ConsolidationUnit,

  I_CompanyCode.ChartOfAccounts       as ReferenceChartOfAccounts,

  I_CnsldtnVersion.ConsolidationVersion,
  I_CnsldtnVersion.FSItemMappingVersion,

  tf168.curr_group_send               as CnsldtnUnitGroupCrcySource,

  t881.rldnr                          as ConsolidationLedger,

  I_FiscalCalendarDate.FiscalPeriod,
  I_FiscalCalendarDate.FiscalYear,
  I_FiscalCalendarDate.FiscalYearPeriod,

  // mandatory standard fields

  Source.PartnerCompany,
  Source.BalanceTransactionCurrency,
  Source.BaseUnit,
  Source.FinancialTransactionType,
  Source.FunctionalArea,
  Source.BusinessArea,
  Source.CostCenter,
  Source.GLAccount,
  Source.ProfitCenter,
  Source.AmountInBalanceTransacCrcy   as AmountInTransactionCurrency,
  Source.AmountInCompanyCodeCurrency  as AmountInLocalCurrency,
  Source.AmountInGlobalCurrency       as AmountInGroupCurrency,
  Source.Quantity                     as QuantityInBaseUnit,
  Source.AmountInFreeDefinedCurrency1 as osl,
  Source.AmountInFreeDefinedCurrency2 as vsl,
  Source.AmountInFreeDefinedCurrency3 as bsl,
  Source.AmountInFreeDefinedCurrency4 as csl,
  Source.AmountInFreeDefinedCurrency5 as dsl,
  Source.AmountInFreeDefinedCurrency6 as esl,
  Source.AmountInFreeDefinedCurrency7 as fsl,
  Source.AmountInFreeDefinedCurrency8 as gsl,
  Source.Segment,

  // specific fileds for this cds view

  Source.CompanyCode,
  Source.SourceLedger,
  Source.Ledger,
  Source.LedgerGLLineItem,
  Source.AccountingDocument,
  Source.FiscalYear                   as ReferenceFiscalYear

}
where
  (
       Source.AccountingDocumentCategory =       ''  //normal documents

    or Source.AccountingDocumentCategory =       'U' //documents without lines in BSEG

    or Source.AccountingDocumentCategory =       'L' //postings not in leading ledger, relevant in case an orientation ledger is used

    or Source.AccountingDocumentCategory =       'P' //predicted documents, posted in a separate extension ledger

    or Source.AccountingDocumentCategory =       'C' //balance Carryforward and Balance Adjustments from Migration

  )

  //  Balance carry forward is done differently in consolidation (e.g. shifted fiscal year)

  //  and must not be taken over from FI

  and  Source.FiscalPeriod               <>      '000'

  // Year End Closing postings are not relevant for consolidation

  and  Source.ReferenceDocumentType      <>      'GLYEC'

  and  Source.CreationDateTime           between :P_CreationDateTimeRgFr and :P_CreationDateTimeRgTo