FAC_CDS_UH_REGIONNODE is a CDS View that provides data about "Universal Hierarchy Region 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: 'FACV_UH_REGNEDGE'
//@ClientHandling.algorithm: #SESSION_VARIABLE@AccessControl.authorizationCheck: #CHECK@EndUserText.label: 'Universal Hierarchy Region Node'
@ObjectModel.usageType: {
dataClass: #MIXED,
serviceQuality: #C,
sizeCategory: #S
}defineview FAC_CDS_UH_REGIONNODE 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
{
key node.node_id as NodeId,
node.node_type as NodeType,
node.ver_id as VersionId,
version.hier_hid as HierarchyId,
version.ver_nbr as VersionNumber,
version.ver_msg as VersionMessage,
version.ver_vldfm as ValidFrom,
casewhen ( ver_status = 'R' or ver_status = 'A' ) and locked_by = $session.user
thencast ( 'I' as vrsst )
else version.ver_status endas VersionStatus,
case node.node_hval
when '' thencast(node.node_lval as ncval)
elsecast (concat(node.node_lval,concat('~',node.node_hval)) as ncval) endas 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 land1) as Country,
cast( upper(ntxt.lval_txt) as nltxt ) as NodeTextUpper,
to_version
}
where version.hier_catg = 'REGN'
and clfdvalue.fld_name = 'COUNTRY'
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'