@AbapCatalog.sqlViewName: 'FACV_UH_RULEHIER'
@AccessControl.authorizationCheck: #MANDATORY
//@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {
dataClass: #MIXED,
serviceQuality: #C,
sizeCategory: #S
}
@EndUserText.label: 'Rule Hierarchy'
@AbapCatalog.compiler.compareFilter:true
define view FAC_CDS_UH_RULEHIER as select from uhdt_vrsn as version
left outer join uhdt_hier as hier on version.hier_hid = hier.hier_hid and
version.hier_catg = hier.hier_catg and
hier.lang = $session.system_language
inner join uhdt_node as root on version.ver_id = root.ver_id
and root.node_type = 'R'
inner join uhdt_clfd_val as scen on version.ver_id = scen.obj_id
and scen.fld_name = 'VALIDATIONSCENARIOID'
association [1..1] to fac_cds_uh_category as to_category on $projection.HierarchyCategory = to_category.CategoryKey
{
version.ver_id as VersionId,
version.ver_vldfm as ValidityStartDate,
version.ver_vldto as ValidityEndDate,
version.ver_msg as VersionMessage,
case
when ( ver_status = 'R' or ver_status = 'A' ) and locked_by = $session.user
then cast ( 'I' as vrsst )
else version.ver_status end as VersionStatus,
cast( '' as vrstxt) as VersionStatusText,
version.hier_catg as HierarchyCategory,
cast( root.node_lval as vhrid) as HierarchyId,
hier.hier_desc as HierarchyText,
cast( root.node_lval as vhdec ) as HierarchyVersionText,
cast( upper(hier.hier_desc) as vhdec ) as HierarchyTextUpper,
cast( scen.val_low as vec_scen_id ) as ValidationScenarioID,
to_category
}
where version.hier_catg = 'GL05'
and version.ver_status <> 'T'
and version.ver_status <> 'B'
and hier.hier_desc is not null
union all
select from uhdt_vrsn as version
left outer join uhdt_hier as hier on version.hier_hid = hier.hier_hid and
version.hier_catg = hier.hier_catg and
hier.lang = $session.system_language
left outer join uhdt_hier as hier_e on version.hier_hid = hier_e.hier_hid and
version.hier_catg = hier_e.hier_catg and
hier_e.lang = 'E'
inner join uhdt_node as root on version.ver_id = root.ver_id
and root.node_type = 'R'
inner join uhdt_clfd_val as scen on version.ver_id = scen.obj_id
and scen.fld_name = 'VALIDATIONSCENARIOID'
association [1..1] to fac_cds_uh_category as to_category on $projection.HierarchyCategory = to_category.CategoryKey
{
version.ver_id as VersionId,
version.ver_vldfm as ValidityStartDate,
version.ver_vldto as ValidityEndDate,
version.ver_msg as VersionMessage,
case
when ( ver_status = 'R' or ver_status = 'A' ) and locked_by = $session.user
then cast ( 'I' as vrsst )
else version.ver_status end as VersionStatus,
cast( '' as vrstxt) as VersionStatusText,
version.hier_catg as HierarchyCategory,
cast( root.node_lval as vhrid) as HierarchyId,
hier_e.hier_desc as HierarchyText,
cast( root.node_lval as vhdec ) as HierarchyVersionText,
cast( upper(hier_e.hier_desc) as vhdec ) as HierarchyTextUpper,
cast( scen.val_low as vec_scen_id ) as ValidationScenarioID,
to_category
}
where version.hier_catg = 'GL05'
and version.ver_status <> 'T'
and version.ver_status <> 'B'
and hier.hier_desc is null