P_ProjRevnRecgnRealTmeIss

DDL: P_PROJREVNRECGNREALTMEISS SQL: PROJEBRRRTISS Type: view CONSUMPTION

Event based rev. rec. Real-time issue

P_ProjRevnRecgnRealTmeIss is a Consumption CDS View that provides data about "Event based rev. rec. Real-time issue" in SAP S/4HANA. It reads from 8 data sources and exposes 49 fields with key field ApplicationLog.

Data Sources (8)

SourceAliasJoin Type
P_EBRRRealTmeApplog Applog from
P_EBRRRealTmeApplog AppLog union
P_ProjRevnRecgnRealTmeApplLog AppLog union
I_CompanyCode CompanyCode inner
I_CompanyCode CompanyCode inner
I_RevnRecgnConstcyLdgrEvalArea ConstcyLdgrEvalArea inner
I_WBSElementBasicData WBSElement inner
I_WBSElementBasicData WBSElement inner

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PROJEBRRRTISS view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Event based rev. rec. Real-time issue view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #MIXED view
VDM.private true view
VDM.viewType #CONSUMPTION view

Fields (49)

KeyFieldSource TableSource FieldDescription
KEY ApplicationLog P_ProjRevnRecgnRealTmeApplLog ApplicationLog
ReferenceDocumentType P_ProjRevnRecgnRealTmeApplLog ReferenceDocumentType
ReferenceOrganizationalUnits P_ProjRevnRecgnRealTmeApplLog ReferenceOrganizationalUnits
ReferenceDocumentContext P_ProjRevnRecgnRealTmeApplLog ReferenceDocumentContext
ReferenceDocument P_ProjRevnRecgnRealTmeApplLog ReferenceDocument
FiscalPeriod P_ProjRevnRecgnRealTmeApplLog FiscalPeriod
FiscalYear P_ProjRevnRecgnRealTmeApplLog FiscalYear
CompanyCode P_ProjRevnRecgnRealTmeApplLog CompanyCode
Project
AccountAssignmentType P_ProjRevnRecgnRealTmeApplLog AccountAssignmentType
NumberOfOpenErrorMessages P_ProjRevnRecgnRealTmeApplLog NumberOfOpenErrorMessages
ApplicationLogHandle P_ProjRevnRecgnRealTmeApplLog ApplicationLogHandle
ApplicationLogSubobject P_ProjRevnRecgnRealTmeApplLog ApplicationLogSubobject
CompanyCodeName
ToFiscalYearPeriod
FiscalYearPeriod
ApplicationLog
ReferenceDocumentType P_ProjRevnRecgnRealTmeApplLog ReferenceDocumentType
ReferenceOrganizationalUnits P_ProjRevnRecgnRealTmeApplLog ReferenceOrganizationalUnits
ReferenceDocumentContext P_ProjRevnRecgnRealTmeApplLog ReferenceDocumentContext
ReferenceDocument P_ProjRevnRecgnRealTmeApplLog ReferenceDocument
FiscalPeriod P_ProjRevnRecgnRealTmeApplLog FiscalPeriod
FiscalYear P_ProjRevnRecgnRealTmeApplLog FiscalYear
CompanyCode P_ProjRevnRecgnRealTmeApplLog CompanyCode
Project JournalEntryItem Project
AccountAssignmentType JournalEntryItem AccountAssignmentType
NumberOfOpenErrorMessages P_ProjRevnRecgnRealTmeApplLog NumberOfOpenErrorMessages
ApplicationLogHandle P_ProjRevnRecgnRealTmeApplLog ApplicationLogHandle
ApplicationLogSubobject P_ProjRevnRecgnRealTmeApplLog ApplicationLogSubobject
CompanyCodeName I_CompanyCode CompanyCodeName
ToFiscalYearPeriod
FiscalYearPeriod
ApplicationLog
ReferenceDocumentType P_ProjRevnRecgnRealTmeApplLog ReferenceDocumentType
ReferenceOrganizationalUnits P_ProjRevnRecgnRealTmeApplLog ReferenceOrganizationalUnits
ReferenceDocumentContext P_ProjRevnRecgnRealTmeApplLog ReferenceDocumentContext
ReferenceDocument P_ProjRevnRecgnRealTmeApplLog ReferenceDocument
FiscalPeriod P_ProjRevnRecgnRealTmeApplLog FiscalPeriod
FiscalYear P_ProjRevnRecgnRealTmeApplLog FiscalYear
CompanyCode P_ProjRevnRecgnRealTmeApplLog CompanyCode
Project
AccountAssignmentType
NumberOfOpenErrorMessages P_ProjRevnRecgnRealTmeApplLog NumberOfOpenErrorMessages
ApplicationLogHandle P_ProjRevnRecgnRealTmeApplLog ApplicationLogHandle
ApplicationLogSubobject P_ProjRevnRecgnRealTmeApplLog ApplicationLogSubobject
CompanyCodeName I_CompanyCode CompanyCodeName
ToFiscalYearPeriod
FiscalYearPeriod
ReferenceDocumentTypeName ReferenceDocumentTypeText ReferenceDocumentTypeName
@AbapCatalog.sqlViewName: 'PROJEBRRRTISS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED

@ClientHandling.algorithm: #SESSION_VARIABLE
@Consumption.dbHints: ['NO_SUBPLAN_SHARING','OPTIMIZATION_LEVEL(COST_BASED)', 'NO_PREDICATE_SIMPLIFICATION']

@EndUserText.label: 'Event based rev. rec. Real-time issue'

@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #MIXED

@VDM.private: true

@VDM.viewType: #CONSUMPTION

define view P_ProjRevnRecgnRealTmeIss
  //----------------------------------------------------------------------------------------------------------------------------------------------------------------

  //1rd Long AppLog

  //----------------------------------------------------------------------------------------------------------------------------------------------------------------

  as select from           P_EBRRRealTmeApplog         as Applog

    inner join             I_WBSElementBasicData       as WBSElement                on WBSElement.WBSElementInternalID = Applog.WBSElementInternalID

    left outer to one join I_ReferenceDocumentTypeText as ReferenceDocumentTypeText on  Applog.ReferenceDocumentType       = ReferenceDocumentTypeText.ReferenceDocumentType
                                                                                    and ReferenceDocumentTypeText.Language = $session.system_language

{
  key Applog.ApplicationLog,
      Applog.ReferenceDocumentType,
      Applog.ReferenceOrganizationalUnits,
      Applog.ReferenceDocumentContext,
      Applog.ReferenceDocument,
      Applog.FiscalPeriod,
      Applog.FiscalYear,
      Applog.CompanyCode                                           as CompanyCode,
      WBSElement._Project.Project                                  as Project,
      Applog.AccountAssignmentType,
      Applog.NumberOfOpenErrorMessages,
      Applog.ApplicationLogHandle,
      Applog.ApplicationLogSubobject,
      WBSElement._CompanyCode.CompanyCodeName                      as CompanyCodeName,

      concat(Applog.FiscalPeriod, concat('.', Applog.FiscalYear) ) as ToFiscalYearPeriod,
      //Period in the format yearmont 2019006

      concat(Applog.FiscalYear, Applog.FiscalPeriod)               as FiscalYearPeriod,

      ReferenceDocumentTypeText.ReferenceDocumentTypeName          as ReferenceDocumentTypeName
}
where
  Applog.AccountAssignmentType = 'PR'

//----------------------------------------------------------------------------------------------------------------------------------------------------------------

//2rd Short AppLog (old)

//----------------------------------------------------------------------------------------------------------------------------------------------------------------

union select from        P_EBRRRealTmeApplog         as AppLog

  left outer to one join I_JournalEntryItem          as JournalEntryItem          on  AppLog.CompanyCode           = JournalEntryItem.CompanyCode
                                                                                  and AppLog.FiscalYear            = JournalEntryItem.FiscalYear
                                                                                  and AppLog.ReferenceDocument     = JournalEntryItem.ReferenceDocument
                                                                                  and AppLog.ReferenceDocumentType = JournalEntryItem.ReferenceDocumentType

  inner join             I_CompanyCode               as CompanyCode               on AppLog.CompanyCode = CompanyCode.CompanyCode

  left outer to one join I_ReferenceDocumentTypeText as ReferenceDocumentTypeText on  AppLog.ReferenceDocumentType       = ReferenceDocumentTypeText.ReferenceDocumentType
                                                                                  and ReferenceDocumentTypeText.Language = $session.system_language

{
  key AppLog.ApplicationLog,
      AppLog.ReferenceDocumentType,
      AppLog.ReferenceOrganizationalUnits,
      AppLog.ReferenceDocumentContext,
      AppLog.ReferenceDocument,
      AppLog.FiscalPeriod,
      AppLog.FiscalYear,
      AppLog.CompanyCode,
      JournalEntryItem.Project,
      JournalEntryItem.AccountAssignmentType,
      AppLog.NumberOfOpenErrorMessages,
      AppLog.ApplicationLogHandle,
      AppLog.ApplicationLogSubobject,
      CompanyCode.CompanyCodeName,

      //Period in the format month.year 006.2019

      concat(AppLog.FiscalPeriod, concat('.', AppLog.FiscalYear) ) as ToFiscalYearPeriod,
      //Period in the format yearmont 2019006

      concat(AppLog.FiscalYear, AppLog.FiscalPeriod)               as FiscalYearPeriod,

      ReferenceDocumentTypeText.ReferenceDocumentTypeName          as ReferenceDocumentTypeName

}
where
          //AppLog.AccountAssignmentType           <>  'PR' //Old short applogs only

    ( AppLog.AccountAssignmentType <> 'PR' //Project

  and AppLog.AccountAssignmentType <> 'VB' //Sales Order

  and AppLog.AccountAssignmentType <> 'SC' //Service Document

  and AppLog.AccountAssignmentType <> 'SV' //Service Document

  and AppLog.AccountAssignmentType <> 'PJ' //Provider Contract

  and AppLog.AccountAssignmentType <> 'OR' //Order


    )

  and(
    (
          JournalEntryItem.Project               <> ''
      and JournalEntryItem.AccountAssignmentType =  'PR'
    )
    // Records without JournalEntryItem will be displayed in this branch of view only

    or    JournalEntryItem.AccountAssignmentType =  ''
  )

//----------------------------------------------------------------------------------------------------------------------------------------------------------------

//3rd for NPI

//----------------------------------------------------------------------------------------------------------------------------------------------------------------


union select from        P_ProjRevnRecgnRealTmeApplLog  as AppLog //NPI part


  inner join             I_CompanyCode                  as CompanyCode               on AppLog.CompanyCode = CompanyCode.CompanyCode

  inner join             I_RevnRecgnConstcyLdgrEvalArea as ConstcyLdgrEvalArea       on ConstcyLdgrEvalArea.CompanyCode = AppLog.CompanyCode

  inner join             I_WBSElementBasicData          as WBSElement                on WBSElement.WBSElementInternalID = AppLog.WBSElementInternalID

  left outer to one join I_ReferenceDocumentTypeText    as ReferenceDocumentTypeText on  AppLog.ReferenceDocumentType       = ReferenceDocumentTypeText.ReferenceDocumentType
                                                                                     and ReferenceDocumentTypeText.Language = $session.system_language

{
  key AppLog.ApplicationLog,
      AppLog.ReferenceDocumentType,
      AppLog.ReferenceOrganizationalUnits,
      AppLog.ReferenceDocumentContext,
      AppLog.ReferenceDocument,
      AppLog.FiscalPeriod,
      AppLog.FiscalYear,
      AppLog.CompanyCode,
      WBSElement._Project.Project,
      //dummy as it not needed for NPI

      cast( 'PR' as char8 )                                          as AccountAssignmentType,
      AppLog.NumberOfOpenErrorMessages,
      AppLog.ApplicationLogHandle,
      AppLog.ApplicationLogSubobject,
      CompanyCode.CompanyCodeName,

      //Period in the format month.year 006.2019

      concat(AppLog.FiscalPeriod, concat('.', AppLog.FiscalYear) ) as ToFiscalYearPeriod,
      //Period in the format yearmont 2019006

      concat(AppLog.FiscalYear, AppLog.FiscalPeriod)               as FiscalYearPeriod,

      ReferenceDocumentTypeText.ReferenceDocumentTypeName          as ReferenceDocumentTypeName

}
group by

  AppLog.ApplicationLog,
  AppLog.ReferenceDocument,
  AppLog.ReferenceOrganizationalUnits,
  AppLog.ReferenceDocumentContext,
  AppLog.ReferenceDocumentType,
  AppLog.CompanyCode,
  CompanyCode.CompanyCodeName,
  AppLog.NumberOfOpenErrorMessages,
  AppLog.FiscalPeriod,
  AppLog.FiscalYear,
  ReferenceDocumentTypeText.ReferenceDocumentTypeName,
  WBSElement._Project.Project,
  AppLog.ApplicationLogHandle,
  AppLog.ApplicationLogSubobject
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_JOURNALENTRYITEM",
"I_PROJECTBASICDATA",
"I_REFERENCEDOCUMENTTYPETEXT",
"I_REVNRECGNCONSTCYLDGREVALAREA",
"I_WBSELEMENTBASICDATA",
"P_EBRRREALTMEAPPLOG",
"P_PROJREVNRECGNREALTMEAPPLLOG"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/