@AccessControl.authorizationCheck: #NOT_ALLOWED
@EndUserText.label: 'Derive ODP Name'
define view entity RSODP_ABAP_CDS_ODPNAME_LIST
with parameters defaultCategory :rodps_semantics,
langu :sylangu
as select from RSODP_ABAP_CDS_ODPNAME as o
left outer join ddheadanno as h1 on h1.strucobjn = o.cdsViewName and h1.name = 'ANALYTICS.DATACATEGORY'
left outer join ddheadanno as h2 on h2.strucobjn = o.cdsViewName and h2.name = 'OBJECTMODEL.DATACATEGORY'
left outer join ddheadanno as h3 on h3.strucobjn = o.cdsViewName and h3.name = 'ANALYTICS.QUERY'
left outer join ddheadanno as h4 on h4.strucobjn = o.cdsViewName and h4.name = 'ANALYTICS.DATAEXTRACTION.ENABLED'
left outer join ddheadanno as h5 on h5.strucobjn = o.cdsViewName and h4.name = 'ANALYTICS.HIDDEN'
left outer join ddddlsrc02bt as t on o.ddlName = t.ddlname and o.cdsViewName = t.strucobjn and t.ddlanguage = $parameters.langu and t.as4local = 'A'
{
key cast( o.odpName as rodps_odpname ) as odpPrefix,
cast(o.cdsViewName as ddstrucobjname ) as cdsViewName,
o.ddlName,
o.sourceType,
o.devClass,
o.createdOnDate,
o.changedAtDate,
o.changedAtTime,
o.changedBy,
coalesce( h1.value, h2.value ) as dataCategory,
cast( case when h3.value is null or h3.value = 'false' then ' ' else 'X' end as rs_bool ) as isQuery,
cast( case when h1.value is null then ' '
when h1.value = '#FACT' then ' '
else 'X'
end as rs_bool ) as isCube,
cast( case when h4.value is null or h4.value = 'false' then ' ' else 'X' end as rs_bool ) as isExtractor,
cast( case when h5.value is null or h5.value = 'false' then ' ' else 'X' end as rs_bool ) as isHidden,
cast( case when h3.value = '' or h3.value = 'true' then ''
when h1.value is null and h2.value is null then $parameters.defaultCategory
when h1.value is null and h2.value = '#TEXT' then 'T'
when h1.value is null and h2.value = '#HIERARCHY' then 'H'
when h1.value is null and h2.value = '#VALUE_HELP' then 'V'
when h1.value = '#DIMENSION' then 'P'
else 'F'
end as rodps_semantics ) as semantics,
cast( case when h3.value = '' or h3.value = 'true' then o.odpName
when h1.value is null and h2.value is null then concat( o.odpName, concat( '$', $parameters.defaultCategory ) )
when h1.value is null and h2.value = '#TEXT' then concat( o.odpName, '$T' )
when h1.value is null and h2.value = '#HIERARCHY' then concat( o.odpName, '$H' )
when h1.value is null and h2.value = '#VALUE_HELP' then concat( o.odpName, '$V' )
when h1.value = '#DIMENSION' then concat( o.odpName, '$P' )
else concat( o.odpName, '$F' )
end as rodps_odpname ) as odpName,
coalesce( t.ddtext, o.cdsViewName ) as odpDescr,
o._changedBy as _changedBy
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"RSODP_ABAP_CDS_ODPNAME",
"DDDDLSRC02BT",
"DDHEADANNO"
],
"ASSOCIATED":
[
"I_USER"
],
"BASE":
[
"RSODP_ABAP_CDS_ODPNAME"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/