FAC_CDS_UH_GLACCOUNTNODE is a CDS View that provides data about "Universal Hierarchy G/L Account Node" in SAP S/4HANA. It reads from 4 data sources (uhdt_clfd_val, uhdt_node, uhdt_ntxt, uhdt_vrsn) and exposes 14 fields with key field NodeId.
@AbapCatalog.sqlViewName: 'FAC_UH_GLACCOUNT'
@ObjectModel.usageType: {
dataClass: #MIXED,
serviceQuality: #C,
sizeCategory: #S
}@AccessControl.authorizationCheck: #CHECK@EndUserText.label: 'Universal Hierarchy G/L Account Node'
defineview FAC_CDS_UH_GLACCOUNTNODE asselectfrom uhdt_node as node
innerjoin uhdt_vrsn as version on node.ver_id = version.ver_id
innerjoin uhdt_clfd_val as clfdvalue on node.ver_id = clfdvalue.obj_id
leftouterjoin uhdt_ntxt as ntxt on node.node_id = ntxt.node_id
and ntxt.lang = $session.system_language
association[1..1] to fac_cds_uh_version as to_version on $projection.VersionId = to_version.VersionId
association[0..*] to uhdt_nattrvals as to_attr on node.node_id = to_attr.node_id
{
key node.node_id as NodeId,
node.node_type as NodeType,
to_attr[1: attr_name = 'NODE_SYMBOL'].attr_lval as SYMBOL,
node.ver_id as VersionId,
version.hier_hid as HierarchyId,
version.ver_nbr as VersionNumber,
version.ver_msg as VersionMessage,
casewhen ( ver_status = 'R' or ver_status = 'A' ) and locked_by = $session.user
thencast ('I' as vrsst )
else version.ver_status endas VersionStatus,
cast(node.node_lval as ncval) as NodeValue,
ntxt.lval_txt as NodeText,
casewhen node.node_hval = '' thencasewhen ntxt.lval_txt isnullor ntxt.lval_txt = '' thencast( node.node_lval as nltxt )
elsecast( concat( node.node_lval, concat(' (',concat( ntxt.lval_txt, ')' ) ) ) as nltxt ) endelsecast (concat(node.node_lval,concat('~',node.node_hval)) as nltxt) endas NodeValueText,
cast( clfdvalue.val_low as ktopl) as ChartOfAccounts,
cast( upper(ntxt.lval_txt) as nltxt ) as NodeTextUpper,
to_version
}
where version.hier_catg = '0109'
and clfdvalue.fld_name = 'CHARTOFACCOUNTS'
and (node.node_type = 'N' or node.node_type = 'R' or node.node_type = 'Z')
and version.ver_status <> 'T'
and version.ver_status <> 'B'