@AbapCatalog.sqlViewName: 'VBCORECDSVIEWS'
@EndUserText.label: 'View Browser Core CDS Views'
@ObjectModel.usageType.serviceQuality: #P
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.supportedCapabilities: [#CDS_MODELING_DATA_SOURCE]
define view Vb_Core_Cdsviews
as select from Cds_Views_Info
left outer join Cds_View_Annotation_Position as CDSAnalyticType on Cds_Views_Info.CDSName = CDSAnalyticType.CDSName
and CDSAnalyticType.AnnotationName = 'ANALYTICS.QUERY'
and CDSAnalyticType.AnnotationValue = 'true'
left outer join Cds_View_Annotation_Position as CDSDataCategory on Cds_Views_Info.CDSName = CDSDataCategory.CDSName
and CDSDataCategory.AnnotationName = 'ANALYTICS.DATACATEGORY'
//this will be used to indentify private view
left outer join Cds_View_Annotation_Position as CDSPrivate on Cds_Views_Info.CDSName = CDSPrivate.CDSName
and CDSPrivate.AnnotationName = 'VDM.PRIVATE'
and CDSPrivate.AnnotationValue = 'true'
// Checking Released / Deprecated CDS views and Customer-Specific Objects of any release group
left outer join ARS_APIS_RELEASED_C1_OR_GROUPS as Cds_Release_Status on Cds_Views_Info.DDLSourceName = Cds_Release_Status.tadir_obj_name
and Cds_Release_Status.tadir_object = 'DDLS'
// DD02B displays name of the CDS view in the raw camel case format.
left outer join dd02b on dd02b.strucobjn = Cds_Views_Info.DDLSourceName
and dd02b.as4local = 'A'
left outer join CDS_SUPPORTED_CAPABILITIES as SupportCapabilities on SupportCapabilities.CDSName = Cds_Views_Info.DDLSourceName
left outer join Cds_View_Annotation_Position as CDSModelingPattern on Cds_Views_Info.CDSName = CDSModelingPattern.CDSName
and CDSModelingPattern.AnnotationName = 'OBJECTMODEL.MODELINGPATTERN'
association [0..*] to vdm_browsertag as _CdsViewUserTag on $projection.DDLSourceName = _CdsViewUserTag.ddlsourcename
and _CdsViewUserTag.username = $session.user
association [0..*] to Cds_View_Parameter as _CdsViewParameter on $projection.CDSName = _CdsViewParameter.CDSName
association [1..*] to Vb_Core_Cds_Definition as _CdsDefinition on $projection.CDSName = _CdsDefinition.SQLViewName
association [0..*] to Vb_Core_Cds_Annotation as _CdsViewAnnotation on $projection.CDSName = _CdsViewAnnotation.CDSName
association [1..*] to VB_CDS_CROSSREFERENCE as _CdsViewCrossreference on $projection.CDSName = _CdsViewCrossreference.ObjectDDLSourceName
association [0..1] to Cds_Editors_Text as _EditorText on $projection.CDSOriginKey = _EditorText.CDSOrigin
and _EditorText.Language = $session.system_language
association [0..*] to report_chips as _AnalyticalQueryPublished on $projection.DDLSourceName = _AnalyticalQueryPublished.ddlsourcename
{
key Cds_Views_Info.DDLSourceName,
// Raw Text representation of CDS View Name. If text is null, use DDLSourceName key.
coalesce( dd02b.strucobjn_raw, Cds_Views_Info.DDLSourceName ) as DDLSourceNameText,
Cds_Views_Info.SQLViewName as SQLViewName,
Cds_Views_Info.CDSName,
cast( Cds_Views_Info.CdsViewType as vdmviewtype ) as CdsViewType,
Cds_Views_Info.ApplicationComponent,
Cds_Views_Info.ApplicationComponentName,
Cds_Views_Info.CDSViewPackage,
Cds_Views_Info.CDSViewSourceSystem,
case when CDSAnalyticType.AnnotationValue = 'true'
then 1 //Analytic Query
else 2 //Non-Analytic Query
end as CDSType,
case when CDSAnalyticType.AnnotationValue = 'true' then 'QUERY'
when CDSDataCategory.AnnotationValue = '#DIMENSION' then 'DIMENSION'
when CDSDataCategory.AnnotationValue = '#CUBE' then 'CUBE'
when CDSDataCategory.AnnotationValue = '#TEXT' then 'TEXT'
when CDSDataCategory.AnnotationValue = '#FACT' then 'FACT'
when CDSDataCategory.AnnotationValue = '#AGGREGATIONLEVEL' then 'AGGREGATIONLEVEL'
when CDSDataCategory.AnnotationValue = '#HIERARCHY' then 'HIERARCHY'
else CDSDataCategory.AnnotationValue
end as CDSViewCategory,
cast ( case when Cds_Release_Status.state = 'RELEASED'
then 'X' //Released
else '' //Not released
end as boolean) as CDSReleaseStatus,
cast ( case when Cds_Release_Status.state = 'DEPRECATED'
then 'X' //Deprecated
else '' //Not Deprecated,
end as boolean) as DeprecatedStatus,
//if view is private then CDSPrivate='X' else '' for now this field is exposed in VB_CDSVIEWS_QUERY
//and used in VB_CDSVIEWS_QUERY_CE to filter out private views
cast ( case when CDSPrivate.AnnotationValue is not null and CDSPrivate.AnnotationValue = 'true'
then 'X' //Private
else '' //Not Private
end as boolean) as CDSPrivate,
cast(Cds_Views_Info.CDSOriginKey as abap.char( 10 )) as CDSOriginKey,
SupportCapabilities.SupportedCapability as SupportedCapability,
SupportCapabilities.NumberOfCapabilities as NumberOfCapabilities,
CDSModelingPattern.AnnotationValue as ModelingPattern,
/* Associations */
_CdsViewUserTag,
_CdsViewParameter,
_CdsDefinition,
_CdsViewAnnotation,
_CdsViewCrossreference,
_EditorText,
_AnalyticalQueryPublished,
Cds_Views_Info._CdsSupportedCapabilities,
Cds_Views_Info._CDSAppCompText,
Cds_Views_Info._CdsFavorite,
Cds_Views_Info._CdsTagCount,
Cds_Views_Info._Text,
Cds_Views_Info.SourceType
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"ARS_APIS_RELEASED_C1_OR_GROUPS",
"CDS_SUPPORTED_CAPABILITIES",
"CDS_VIEWS_INFO",
"CDS_VIEW_ANNOTATION_POSITION",
"DD02B"
],
"ASSOCIATED":
[
"APPLICATION_COMPONENT_TEXT",
"CDS_ALL_SUPPORTED_CAPABILITIES",
"CDS_EDITORS_TEXT",
"CDS_VIEWS_FAVORITE",
"CDS_VIEWS_TAG_COUNT",
"CDS_VIEW_PARAMETER",
"CDS_VIEW_TEXT",
"VB_CDS_CROSSREFERENCE",
"VB_CORE_CDS_ANNOTATION",
"VB_CORE_CDS_DEFINITION",
"REPORT_CHIPS",
"VDM_BROWSERTAG"
],
"BASE":
[
"CDS_VIEWS_INFO"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/