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