@AbapCatalog.sqlViewName: 'PROSAFTANLTYPIT'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.viewType: #CONSUMPTION
@VDM.private:true
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_RO_SAFTAnalysisTypeItem
with parameters
P_AlternativeGLAccountIsUsed : saft_ro_alt_gl_account_flag,
P_FromPostingDate : dats
// Profit Centers
as select from P_RO_SAFTJournalEntryItemExc(P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed) as JournalEntry
inner join I_StRpJournalEntryHeaderLog as Log on Log.AccountingDocument = JournalEntry.AccountingDocument
and Log.CompanyCode = JournalEntry.CompanyCode
and Log.FiscalYear = JournalEntry.FiscalYear
{
key JournalEntry.SourceLedger,
key JournalEntry.Ledger,
key JournalEntry.CompanyCode,
key JournalEntry.FiscalYear,
key JournalEntry.AccountingDocument,
key JournalEntry.LedgerGLLineItem,
key Log.StatryRptCategory,
key Log.StatryRptgEntity,
key Log.StatryRptRunID,
key JournalEntry.AccountingDocumentType,
key JournalEntry.PostingDate,
key cast('PC' as /ceecv/roanaltype) as RO_SAFTAnalysisType,
cast(JournalEntry.ProfitCenter as /ceecv/ro_analysis_id) as RO_SAFTAnalysisEntry,
case JournalEntry._ProfitCenterTxt[1: Language = '4' and ValidityStartDate <= $parameters.P_FromPostingDate and ValidityEndDate >= $parameters.P_FromPostingDate].ProfitCenterLongName
when '' then cast(JournalEntry._ProfitCenterTxt[1: Language = '4' and ValidityStartDate <= $parameters.P_FromPostingDate and ValidityEndDate >= $parameters.P_FromPostingDate].ProfitCenterName as /ceecv/roanals_type_desc)
else cast(JournalEntry._ProfitCenterTxt[1: Language = '4' and ValidityStartDate <= $parameters.P_FromPostingDate and ValidityEndDate >= $parameters.P_FromPostingDate].ProfitCenterLongName as /ceecv/roanals_type_desc)
end as RO_SAFTAnalysisEntryDesc
}
where
JournalEntry.ProfitCenter is not initial
// Cost Centers
union all select from P_RO_SAFTJournalEntryItemExc(P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed) as JournalEntry
inner join I_StRpJournalEntryHeaderLog as Log on Log.AccountingDocument = JournalEntry.AccountingDocument
and Log.CompanyCode = JournalEntry.CompanyCode
and Log.FiscalYear = JournalEntry.FiscalYear
{
key JournalEntry.SourceLedger,
key JournalEntry.Ledger,
key JournalEntry.CompanyCode,
key JournalEntry.FiscalYear,
key JournalEntry.AccountingDocument,
key JournalEntry.LedgerGLLineItem,
key Log.StatryRptCategory,
key Log.StatryRptgEntity,
key Log.StatryRptRunID,
key JournalEntry.AccountingDocumentType,
key JournalEntry.PostingDate,
key cast('CC' as /ceecv/roanaltype) as RO_SAFTAnalysisType,
JournalEntry.CostCenter as RO_SAFTAnalysisEntry,
case JournalEntry._CostCenterTxt[1: Language = '4' and ValidityStartDate <= $parameters.P_FromPostingDate and ValidityEndDate >= $parameters.P_FromPostingDate].CostCenterDescription
when '' then cast(JournalEntry._CostCenterTxt[1: Language = '4' and ValidityStartDate <= $parameters.P_FromPostingDate and ValidityEndDate >= $parameters.P_FromPostingDate].CostCenterName as /ceecv/roanals_type_desc)
else cast(JournalEntry._CostCenterTxt[1: Language = '4' and ValidityStartDate <= $parameters.P_FromPostingDate and ValidityEndDate >= $parameters.P_FromPostingDate].CostCenterDescription as /ceecv/roanals_type_desc)
end as RO_SAFTAnalysisEntryDesc
}
where
JournalEntry.CostCenter is not initial
// Segments
union all select from P_RO_SAFTJournalEntryItemExc(P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed) as JournalEntry
inner join I_StRpJournalEntryHeaderLog as Log on Log.AccountingDocument = JournalEntry.AccountingDocument
and Log.CompanyCode = JournalEntry.CompanyCode
and Log.FiscalYear = JournalEntry.FiscalYear
{
key JournalEntry.SourceLedger,
key JournalEntry.Ledger,
key JournalEntry.CompanyCode,
key JournalEntry.FiscalYear,
key JournalEntry.AccountingDocument,
key JournalEntry.LedgerGLLineItem,
key Log.StatryRptCategory,
key Log.StatryRptgEntity,
key Log.StatryRptRunID,
key JournalEntry.AccountingDocumentType,
key JournalEntry.PostingDate,
key cast('SEG' as /ceecv/roanaltype) as RO_SAFTAnalysisType,
JournalEntry.Segment as RO_SAFTAnalysisEntry,
cast(JournalEntry._SegmentText[1: Language = '4'].SegmentName as /ceecv/roanals_type_desc) as RO_SAFTAnalysisEntryDesc
}
where
JournalEntry.Segment is not initial
// WBS Elements
union all select from P_RO_SAFTJournalEntryItemExc(P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed) as JournalEntry
inner join I_StRpJournalEntryHeaderLog as Log on Log.AccountingDocument = JournalEntry.AccountingDocument
and Log.CompanyCode = JournalEntry.CompanyCode
and Log.FiscalYear = JournalEntry.FiscalYear
{
key JournalEntry.SourceLedger,
key JournalEntry.Ledger,
key JournalEntry.CompanyCode,
key JournalEntry.FiscalYear,
key JournalEntry.AccountingDocument,
key JournalEntry.LedgerGLLineItem,
key Log.StatryRptCategory,
key Log.StatryRptgEntity,
key Log.StatryRptRunID,
key JournalEntry.AccountingDocumentType,
key JournalEntry.PostingDate,
key cast('WBS' as /ceecv/roanaltype) as RO_SAFTAnalysisType,
JournalEntry.WBSElement as RO_SAFTAnalysisEntry,
cast(JournalEntry._WBSElementBasicDataText.WBSDescription as /ceecv/roanals_type_desc) as RO_SAFTAnalysisEntryDesc
}
where
JournalEntry.WBSElement is not initial
// Orders
union all select from P_RO_SAFTJournalEntryItemExc(P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed) as JournalEntry
inner join I_StRpJournalEntryHeaderLog as Log on Log.AccountingDocument = JournalEntry.AccountingDocument
and Log.CompanyCode = JournalEntry.CompanyCode
and Log.FiscalYear = JournalEntry.FiscalYear
{
key JournalEntry.SourceLedger,
key JournalEntry.Ledger,
key JournalEntry.CompanyCode,
key JournalEntry.FiscalYear,
key JournalEntry.AccountingDocument,
key JournalEntry.LedgerGLLineItem,
key Log.StatryRptCategory,
key Log.StatryRptgEntity,
key Log.StatryRptRunID,
key JournalEntry.AccountingDocumentType,
key JournalEntry.PostingDate,
key cast('ORD' as /ceecv/roanaltype) as RO_SAFTAnalysisType,
JournalEntry.OrderID as RO_SAFTAnalysisEntry,
cast(JournalEntry._Order.OrderDescription as /ceecv/roanals_type_desc) as RO_SAFTAnalysisEntryDesc
}
where
JournalEntry.OrderID is not initial
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COSTCENTERTEXT",
"I_ORDER",
"I_PROFITCENTERTEXT",
"I_SEGMENTTEXT",
"I_STRPJOURNALENTRYHEADERLOG",
"I_WBSELEMENTBASICDATA",
"P_RO_SAFTJOURNALENTRYITEMEXC"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/