P_SlsOrdRevnRecgnRealTmeIss

DDL: P_SLSORDREVNRECGNREALTMEISS SQL: PSOEBRRRTISS Type: view CONSUMPTION

Event based rev. rec. Real-time issue

P_SlsOrdRevnRecgnRealTmeIss is a Consumption CDS View that provides data about "Event based rev. rec. Real-time issue" in SAP S/4HANA. It reads from 4 data sources (P_EBRRRealTmeApplog, P_EBRRRealTmeApplog, I_CompanyCode, I_CompanyCode) and exposes 33 fields with key field ApplicationLog.

Data Sources (4)

SourceAliasJoin Type
P_EBRRRealTmeApplog AppLog from
P_EBRRRealTmeApplog AppLog union
I_CompanyCode CompanyCode inner
I_CompanyCode CompanyCode inner

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PSOEBRRRTISS 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 (33)

KeyFieldSource TableSource FieldDescription
KEY ApplicationLog P_EBRRRealTmeApplog ApplicationLog
ReferenceDocumentType P_EBRRRealTmeApplog ReferenceDocumentType
ReferenceOrganizationalUnits P_EBRRRealTmeApplog ReferenceOrganizationalUnits
ReferenceDocumentContext P_EBRRRealTmeApplog ReferenceDocumentContext
ReferenceDocument P_EBRRRealTmeApplog ReferenceDocument
FiscalPeriod P_EBRRRealTmeApplog FiscalPeriod
FiscalYear P_EBRRRealTmeApplog FiscalYear
CompanyCode I_CompanyCode CompanyCode
SalesDocument P_EBRRRealTmeApplog SalesDocument
AccountAssignmentType P_EBRRRealTmeApplog AccountAssignmentType
NumberOfOpenErrorMessages P_EBRRRealTmeApplog NumberOfOpenErrorMessages
ApplicationLogHandle P_EBRRRealTmeApplog ApplicationLogHandle
ApplicationLogSubobject P_EBRRRealTmeApplog ApplicationLogSubobject
CompanyCodeName I_CompanyCode CompanyCodeName
ToFiscalYearPeriod
FiscalYearPeriod
ApplicationLog
ReferenceDocumentType P_EBRRRealTmeApplog ReferenceDocumentType
ReferenceOrganizationalUnits P_EBRRRealTmeApplog ReferenceOrganizationalUnits
ReferenceDocumentContext P_EBRRRealTmeApplog ReferenceDocumentContext
ReferenceDocument P_EBRRRealTmeApplog ReferenceDocument
FiscalPeriod P_EBRRRealTmeApplog FiscalPeriod
FiscalYear P_EBRRRealTmeApplog FiscalYear
CompanyCode P_EBRRRealTmeApplog CompanyCode
SalesDocument JournalEntryItem SalesDocument
AccountAssignmentType JournalEntryItem AccountAssignmentType
NumberOfOpenErrorMessages P_EBRRRealTmeApplog NumberOfOpenErrorMessages
ApplicationLogHandle P_EBRRRealTmeApplog ApplicationLogHandle
ApplicationLogSubobject P_EBRRRealTmeApplog ApplicationLogSubobject
CompanyCodeName I_CompanyCode CompanyCodeName
ToFiscalYearPeriod
FiscalYearPeriod
ReferenceDocumentTypeName ReferenceDocumentTypeText ReferenceDocumentTypeName
@AbapCatalog.sqlViewName: 'PSOEBRRRTISS'
@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
//----------------------------------------------------------------------------------------------------------------------------------------------------------------

//1rd Long AppLog

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

define view P_SlsOrdRevnRecgnRealTmeIss
  as select from           P_EBRRRealTmeApplog         as AppLog

    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,
      CompanyCode.CompanyCode,
      AppLog.SalesDocument,
      AppLog.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 yearmonth 2019006

      concat(AppLog.FiscalYear, AppLog.FiscalPeriod)               as FiscalYearPeriod,
      ReferenceDocumentTypeText.ReferenceDocumentTypeName          as ReferenceDocumentTypeName
}
where
  AppLog.AccountAssignmentType = 'VB'

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

//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.SalesDocument,
      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           <> 'VB' //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.AccountAssignmentType =  'VB'
      or JournalEntryItem.AccountAssignmentType =  'EO'
    )
    and  JournalEntryItem.SalesDocument         <> ''
  )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_JOURNALENTRYITEM",
"I_REFERENCEDOCUMENTTYPETEXT",
"P_EBRRREALTMEAPPLOG"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/