@AbapCatalog.sqlViewName: 'IFSVSTR'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.viewType: #COMPOSITE
@ObjectModel: {
usageType: {
dataClass: #MASTER,
serviceQuality: #D,
sizeCategory: #XXL
}
}
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Financial Statement Version Structure'
define view I_FinancialStatementStructure as select from I_FinancialStatementHier as h
inner join I_FinancialStatementHierNode as n on h.FinancialStatementHierarchy = n.FinancialStatementHierarchy
and h.ValidityEndDate = n.ValidityEndDate
association [0..*] to I_FinancialStatementHierNodeT as _HierNodeText on $projection.FinancialStatementHierarchy = _HierNodeText.FinancialStatementHierarchy
and $projection.ValidityEndDate = _HierNodeText.ValidityEndDate
and $projection.HierarchyNode = _HierNodeText.HierarchyNode
{
key h.FinancialStatementHierarchy,
@Semantics.businessDate.to: true
key h.ValidityEndDate,
key case h.ChartOfAccounts
when '' then n.ChartOfAccounts
else h.ChartOfAccounts end as ChartOfAccounts,
key n.HierarchyNode,
key n.ParentNode,
n.FinancialStatementNodeType,
case n.HierarchyNodeVal
when '0ASSETS' then case when h.FinancialStatementAssetsItem is not null then h.FinancialStatementAssetsItem else 'ASSETS' end
when '0LIABILITS' then case when h.FinStatementLiabilitiesItem is not null then h.FinStatementLiabilitiesItem else 'LIABILITS' end
when '0BSLOSS' then case when h.FinancialStatementNetLossItem is not null then h.FinancialStatementNetLossItem else 'BSLOSS' end
when '0BSPROFIT' then case when h.FinStatementNetProfitItem is not null then h.FinStatementNetProfitItem else 'BSPROFIT' end
when '0PLPROFIT' then case when h.FinStatementProfitAndLossItem is not null then h.FinStatementProfitAndLossItem else 'PLPROFIT' end
when '0BSNOTES' then case when h.FinancialStatementNotesItem is not null then h.FinancialStatementNotesItem else 'BSNOTES' end
when '0NOTASSGND' then case when h.FinancialStatementOrphansItem is not null then h.FinancialStatementOrphansItem else 'NOTASSGND' end
else n.HierarchyNodeVal end as HierarchyNodeVal,
case n._ParentNode.HierarchyNodeVal
when '0ASSETS' then case when h.FinancialStatementAssetsItem is not null then h.FinancialStatementAssetsItem else 'ASSETS' end
when '0LIABILITS' then case when h.FinStatementLiabilitiesItem is not null then h.FinStatementLiabilitiesItem else 'LIABILITS' end
when '0BSLOSS' then case when h.FinancialStatementNetLossItem is not null then h.FinancialStatementNetLossItem else 'BSLOSS' end
when '0BSPROFIT' then case when h.FinStatementNetProfitItem is not null then h.FinStatementNetProfitItem else 'BSPROFIT' end
when '0PLPROFIT' then case when h.FinStatementProfitAndLossItem is not null then h.FinStatementProfitAndLossItem else 'PLPROFIT' end
when '0BSNOTES' then case when h.FinancialStatementNotesItem is not null then h.FinancialStatementNotesItem else 'BSNOTES' end
when '0NOTASSGND' then case when h.FinancialStatementOrphansItem is not null then h.FinancialStatementOrphansItem else 'NOTASSGND' end
else n._ParentNode.HierarchyNodeVal end as HierarchyParentNodeVal,
@Semantics.businessDate.from: true
h.ValidityStartDate,
h.HierarchyType,
h.GroupChartOfAccountIsUsed,
h.FunctionalAreaIsUsed,
n.HierarchyLevel,
n.HierarchyNodeSequence,
@Semantics.signReversalIndicator: true
n.SignIsInverted,
h._Text as _HierText,
_HierNodeText
} where n.ParentNode <> '00NOTASSGND' and not h.FinancialStatementHierarchy like '%_DRAFT'
and n.HierarchyNode <> '1COA0PLRESULTA'
and n.HierarchyNode <> '1COA0BSRESULT1A'
and n.HierarchyNode <> '1COA0BSRESULT2A'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_FINANCIALSTATEMENTHIER",
"I_FINANCIALSTATEMENTHIERNODE"
],
"ASSOCIATED":
[
"I_FINANCIALSTATEMENTHIERNODET",
"I_FINANCIALSTATEMENTHIERT"
],
"BASE":
[
"I_FINANCIALSTATEMENTHIER"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/