RSODP_ABAP_CDS_ODPNAME_LIST is a CDS View that provides data about "Derive ODP Name" in SAP S/4HANA. It reads from 7 data sources and exposes 17 fields with key field odpPrefix.
@AccessControl.authorizationCheck: #NOT_ALLOWED@EndUserText.label: 'Derive ODP Name'
defineviewentity RSODP_ABAP_CDS_ODPNAME_LIST
withparameters defaultCategory :rodps_semantics,
langu :sylangu
asselectfrom RSODP_ABAP_CDS_ODPNAME as o
leftouterjoin ddheadanno as h1 on h1.strucobjn = o.cdsViewName and h1.name = 'ANALYTICS.DATACATEGORY'
leftouterjoin ddheadanno as h2 on h2.strucobjn = o.cdsViewName and h2.name = 'OBJECTMODEL.DATACATEGORY'
leftouterjoin ddheadanno as h3 on h3.strucobjn = o.cdsViewName and h3.name = 'ANALYTICS.QUERY'
leftouterjoin ddheadanno as h4 on h4.strucobjn = o.cdsViewName and h4.name = 'ANALYTICS.DATAEXTRACTION.ENABLED'
leftouterjoin ddheadanno as h5 on h5.strucobjn = o.cdsViewName and h4.name = 'ANALYTICS.HIDDEN'
leftouterjoin ddddlsrc02bt as t on o.ddlName = t.ddlname and o.cdsViewName = t.strucobjn and t.ddlanguage = $parameters.langu and t.as4local = 'A'
{
keycast( 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( casewhen h3.value isnullor h3.value = 'false' then ' ' else 'X' endas rs_bool ) as isQuery,
cast( casewhen h1.value isnullthen ' '
when h1.value = '#FACT' then ' '
else 'X'
endas rs_bool ) as isCube,
cast( casewhen h4.value isnullor h4.value = 'false' then ' ' else 'X' endas rs_bool ) as isExtractor,
cast( casewhen h5.value isnullor h5.value = 'false' then ' ' else 'X' endas rs_bool ) as isHidden,
cast( casewhen h3.value = '' or h3.value = 'true' then ''
when h1.value isnulland h2.value isnullthen $parameters.defaultCategory
when h1.value isnulland h2.value = '#TEXT' then 'T'
when h1.value isnulland h2.value = '#HIERARCHY' then 'H'
when h1.value isnulland h2.value = '#VALUE_HELP' then 'V'
when h1.value = '#DIMENSION' then 'P'
else 'F'
endas rodps_semantics ) as semantics,
cast( casewhen h3.value = '' or h3.value = 'true' then o.odpName
when h1.value isnulland h2.value isnullthen concat( o.odpName, concat( '$', $parameters.defaultCategory ) )
when h1.value isnulland h2.value = '#TEXT' then concat( o.odpName, '$T' )
when h1.value isnulland h2.value = '#HIERARCHY' then concat( o.odpName, '$H' )
when h1.value isnulland h2.value = '#VALUE_HELP' then concat( o.odpName, '$V' )
when h1.value = '#DIMENSION' then concat( o.odpName, '$P' )
else concat( o.odpName, '$F' )
endas rodps_odpname ) as odpName,
coalesce( t.ddtext, o.cdsViewName ) as odpDescr,
o._changedBy as _changedBy
}