@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":""
}
}*/