P_FINSTMTLEAFITEM

CDS View

P_FINSTMTLEAFITEM is a CDS View in S/4HANA. It contains 16 fields. 2 CDS views read from this table.

CDS Views using this table (2)

ViewTypeJoinVDMDescription
P_FinStmtHierarchy view union_all BASIC
P_FSVHierarchy view union_all BASIC

Fields (16)

KeyField CDS FieldsUsed in Views
KEY ergsl ergsl 2
KEY fkber fkber 2
KEY ktopl ktopl 2
KEY saknr saknr 2
KEY UniqueParentID UniqueParentID 2
KEY versn versn 2
child child 2
Description Description 2
ergs2 ergs2 2
id id 2
nextn nextn 2
parent parent 2
stufe stufe 2
type type 2
xhabn xhabn 2
xsoll xsoll 2
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true

@VDM.private:true
@VDM.viewType: #BASIC
@AbapCatalog.sqlViewName: 'PFSLEAFITM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
define view P_FinStmtLeafItem

  as select from I_FinancialStatementItem

    inner join   P_FinStmtLeaf on  I_FinancialStatementItem.FinancialStatementVariant = P_FinStmtLeaf.versn
                               and I_FinancialStatementItem.FinancialStatementItem    = P_FinStmtLeaf.ergsl
                               and I_FinancialStatementItem.NodeType                  = 'P'


{
      //HierarchyUniqueNodeID is null means this leaf node is assigned to unassign node

  key case when P_FinStmtLeaf.HierarchyUniqueNodeID is null
      then cast ( concat(concat( I_FinancialStatementItem.HierarchyNode,P_FinStmtLeaf.ktopl),P_FinStmtLeaf.saknr ) as abap.char(50) )
      else P_FinStmtLeaf.HierarchyUniqueNodeID
  end                                        as HierarchyUniqueNodeID,
  key case when P_FinStmtLeaf.UniqueParentID is null
      then cast ( I_FinancialStatementItem.HierarchyNode as abap.char(50) )
      else P_FinStmtLeaf.UniqueParentID
  end                                        as UniqueParentID,
  key P_FinStmtLeaf.versn,
  key P_FinStmtLeaf.ergsl,
  key P_FinStmtLeaf.ktopl,
  key P_FinStmtLeaf.saknr,
  key P_FinStmtLeaf.fkber,
      P_FinStmtLeaf.type,
      P_FinStmtLeaf.Description,
      P_FinStmtLeaf.xsoll,
      P_FinStmtLeaf.xhabn,
      I_FinancialStatementItem.HierarchyNode as id,
      I_FinancialStatementItem.HierarchyNode as parent,
      cast ('000000' as seu_id)              as nextn,
      cast ('000000' as seu_id)              as child,
      case type
        when 'L' then
          case when P_FinStmtLeaf.HierarchyUniqueNodeID is null
                then cast (I_FinancialStatementItem.FinStatementHierarchyLevelVal as abap.int4) + 1
               else cast (I_FinancialStatementItem.FinStatementHierarchyLevelVal as abap.int4) + 2
          end
        else cast (I_FinancialStatementItem.FinStatementHierarchyLevelVal as abap.int4) + 1
      end                                    as stufe, // stufe + 1 and left padding with '0'

      cast ('' as ergsl)                     as ergs2
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_FINANCIALSTATEMENTITEM",
"P_FINSTMTLEAF"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/