I_CustomCDSViewDatasource_VH

DDL: I_CUSTOMCDSVIEWDATASOURCE_VH Type: view_entity BASIC

List of released CDS views

I_CustomCDSViewDatasource_VH is a Basic CDS View that provides data about "List of released CDS views" in SAP S/4HANA. It reads from 11 data sources and exposes 15 fields. It has 11 associations to related views.

Data Sources (11)

SourceAliasJoin Type
ddheadanno _AclAuthCheck left_outer
ddheadanno _AnalyticsDatacategoryAnno left_outer
ddheadanno _AnaQueryAnno left_outer
DDL_OBJECT_NAMES _ddl_obj_names_for_view left_outer
APS_V_GKE_DDL_MAX_DATE _j_maxdate_released left_outer
ddheadanno _ModelingAssocTargetAnno left_outer
ddheadanno _ModelingDataSourceAnno left_outer
ddheadanno _ObjectModelDatacategoryAnno left_outer
ddheadanno _OdataPublishAnno left_outer
ARS_APIS_RELEASED_C1_OR_GROUPS _released_for_c1_or_group inner
ddddlsrc _src_released inner

Associations (11)

CardinalityTargetAliasCondition
[0..1] dd02b _a_dd02b _a_dd02b.strucobjn = stob.objectname and _a_dd02b.as4local = _j_maxdate_released.min_ddl_state -- Has parameters
[0..1] dd02bnd node_info node_info.strucobjn = stob.objectname and node_info.nodename = '.NODE1' and node_info.as4local = 'A'
[0..1] ddddlsrc02bt _a_text_active _a_text_active.ddlname = _src_released.ddlname and _a_text_active.as4local = 'A' and _a_text_active.ddlanguage = $session.system_language
[0..1] ddddlsrc02bt _a_text_active_def _a_text_active_def.ddlname = _src_released.ddlname and _a_text_active_def.as4local = 'A' and _a_text_active_def.ddlanguage = 'E'
[0..1] ddddlsrct _a_text_fallback _a_text_fallback.ddlname = _src_released.ddlname and _a_text_fallback.as4local = 'A' and _a_text_fallback.ddlanguage = $session.system_language
[0..1] Sacm_Public_Dcl_For_Entity _a_dcl_for_entity _a_dcl_for_entity.entity = stob.objectname
[0..1] I_CustomCDSViewSourceOrigin _SourceOrigin _SourceOrigin.SourceOrigin = _src_released.source_origin
[0..1] I_CustomCDSViewRework_KeyUpper _Rework _Rework.EntityName = _src_released.ddlname
[0..1] I_CustomCDSViewAccProtection _AccessProtection _AccessProtection.AccessProtection = $projection.access_protection
[0..1] I_CustomCDSViewAnaDataCategory _AnaDataCategory _AnaDataCategory.AnalyticsDatacategory = $projection.analytics_datacategory
[0..1] I_CustomCDSViewObjectStatus _ObjectStatus _ObjectStatus.ObjectStatus = $projection.ObjectStatus

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label List of released CDS views view
Metadata.allowExtensions true view
ObjectModel.representativeKey view_name view
Metadata.ignorePropagatedAnnotations true view
VDM.viewType #BASIC view
ObjectModel.dataCategory #VALUE_HELP view
Search.searchable true view

Fields (15)

KeyFieldSource TableSource FieldDescription
ddl_name ddddlsrc ddlname
TaskPriorityId _Rework HighestPriority
TaskPriority _Rework HighestPriorityText Task Priority
TaskPrioritySortOrder _Rework HighestPrioritySortOrder
ReworkIndicator Rework
Category _Rework Category
TaskCategory _Rework CategoryText
view_text_fb _a_text_fallback ddtext
_SourceOrigin _SourceOrigin
_AccessProtection _AccessProtection
_AnaDataCategory _AnaDataCategory
_ObjectStatus _ObjectStatus
_Rework _Rework
_TaskPriority _Rework _TaskPriority
_TaskCategory _Rework _TaskCategory
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'List of released CDS views'
@Metadata.allowExtensions: true
//@UI.presentationVariant: [{visualizations: [{type: #AS_LINEITEM }] }] As per guideliness, must not be used for Valuehelp views

@ObjectModel.representativeKey: 'view_name'
@Metadata.ignorePropagatedAnnotations:true
@VDM.viewType: #BASIC
@ObjectModel.dataCategory: #VALUE_HELP
@Search.searchable: true
/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] } */
define view entity I_CustomCDSViewDatasource_VH

  as select distinct from ddldependency                  as stob

    inner join            ddddlsrc                       as _src_released //...but only those which are of type VIEW...

                                                                                         on  _src_released.ddlname         = stob.ddlname
                                                                                         and (
                                                                                            _src_released.source_type      = 'V'
                                                                                            or _src_released.source_type   = 'W'
                                                                                          )
                                                                                         and _src_released.as4local        = 'A'
                                                                                         and _src_released.parentname      = ''
                                                                                         and (
                                                                                            _src_released.source_origin    = 0
                                                                                            or _src_released.source_origin = 1
                                                                                            or _src_released.source_origin = 3
                                                                                            or _src_released.source_origin = 4
                                                                                            or _src_released.source_origin = 5
                                                                                          )

  //  // get release group for CDS_STOB (!!! release group is defined for STOB object)

    inner join            ARS_APIS_RELEASED_C1_OR_GROUPS as _released_for_c1_or_group    on  _released_for_c1_or_group.object_key  = stob.objectname
                                                                                         and _released_for_c1_or_group.object_type = 'CDS_STOB'
                                                                                         and (
                                                                                            _released_for_c1_or_group.state        = 'RELEASED'
                                                                                            or _released_for_c1_or_group.state     = 'DEPRECATED'
                                                                                          )

  // max and min state and date (do we need it? cds view should be always active)

    left outer join       APS_V_GKE_DDL_MAX_DATE         as _j_maxdate_released          on _j_maxdate_released.ddl_name = _src_released.ddlname

  // get DDIC view of the CDS view: why max state? if N then there will be no DDIC view!.

  // it should be always A

    left outer join       DDL_OBJECT_NAMES               as _ddl_obj_names_for_view      on  _ddl_obj_names_for_view.CDS_DDL = _src_released.ddlname
                                                                                         and _ddl_obj_names_for_view.STATE   = _j_maxdate_released.max_ddl_state

  // get ANALYTICS.QUERY annotation

    left outer join       ddheadanno                     as _AnaQueryAnno                on  _AnaQueryAnno.strucobjn = stob.objectname
                                                                                         and _AnaQueryAnno.name      = 'ANALYTICS.QUERY'

    left outer join       ddheadanno                     as _OdataPublishAnno            on  _OdataPublishAnno.strucobjn = stob.objectname
                                                                                         and _OdataPublishAnno.name      = 'ODATA.PUBLISH'

    left outer join       ddheadanno                     as _AnalyticsDatacategoryAnno   on  _AnalyticsDatacategoryAnno.strucobjn = stob.objectname
                                                                                         and _AnalyticsDatacategoryAnno.name      = 'ANALYTICS.DATACATEGORY'

    left outer join       ddheadanno                     as _ObjectModelDatacategoryAnno on  _ObjectModelDatacategoryAnno.strucobjn = stob.objectname
                                                                                         and _ObjectModelDatacategoryAnno.name      = 'OBJECTMODEL.DATACATEGORY'

    left outer join       ddheadanno                     as _AclAuthCheck                on  _AclAuthCheck.strucobjn = stob.objectname
                                                                                         and _AclAuthCheck.name      = 'ACCESSCONTROL.AUTHORIZATIONCHECK'

    left outer join       ddheadanno                     as _ModelingDataSourceAnno      on  _ModelingDataSourceAnno.strucobjn =    stob.objectname
                                                                                         and _ModelingDataSourceAnno.name      like 'OBJECTMODEL.SUPPORTEDCAPABILITIES%'
                                                                                         and _ModelingDataSourceAnno.value     =    '#CDS_MODELING_DATA_SOURCE'

    left outer join       ddheadanno                     as _ModelingAssocTargetAnno     on  _ModelingAssocTargetAnno.strucobjn =    stob.objectname
                                                                                         and _ModelingAssocTargetAnno.name      like 'OBJECTMODEL.SUPPORTEDCAPABILITIES%'
                                                                                         and _ModelingAssocTargetAnno.value     =    '#CDS_MODELING_ASSOCIATION_TARGET'

  association [0..1] to dd02b                          as _a_dd02b           on  _a_dd02b.strucobjn = stob.objectname
                                                                             and _a_dd02b.as4local  = _j_maxdate_released.min_ddl_state

  -- Has parameters
  association [0..1] to dd02bnd                        as node_info          on  node_info.strucobjn = stob.objectname
                                                                             and node_info.nodename  = '.NODE1'
                                                                             and node_info.as4local  = 'A'

  // Read label that is defined as annotation (if label is defined as metadata extension it can be only retrieved via API)

  association [0..1] to ddddlsrc02bt                   as _a_text_active     on  _a_text_active.ddlname    = _src_released.ddlname
                                                                             and _a_text_active.as4local   = 'A'
                                                                             and _a_text_active.ddlanguage = $session.system_language
  // Read label for english as fallback

  association [0..1] to ddddlsrc02bt                   as _a_text_active_def on  _a_text_active_def.ddlname    = _src_released.ddlname
                                                                             and _a_text_active_def.as4local   = 'A'
                                                                             and _a_text_active_def.ddlanguage = 'E'
  // Read short text as fallback if no label was defined (happens for Custom CDS view that only short text in current language exist)

  association [0..1] to ddddlsrct                      as _a_text_fallback   on  _a_text_fallback.ddlname    = _src_released.ddlname
                                                                             and _a_text_fallback.as4local   = 'A'
                                                                             and _a_text_fallback.ddlanguage = $session.system_language
  association [0..1] to Sacm_Public_Dcl_For_Entity     as _a_dcl_for_entity  on  _a_dcl_for_entity.entity = stob.objectname
  association [0..1] to I_CustomCDSViewSourceOrigin    as _SourceOrigin      on  _SourceOrigin.SourceOrigin = _src_released.source_origin
  association [0..1] to I_CustomCDSViewRework_KeyUpper as _Rework            on  _Rework.EntityName = _src_released.ddlname
  association [0..1] to I_CustomCDSViewAccProtection   as _AccessProtection  on  _AccessProtection.AccessProtection = $projection.access_protection
  association [0..1] to I_CustomCDSViewAnaDataCategory as _AnaDataCategory   on  _AnaDataCategory.AnalyticsDatacategory = $projection.analytics_datacategory
  association [0..1] to I_CustomCDSViewObjectStatus    as _ObjectStatus      on  _ObjectStatus.ObjectStatus = $projection.ObjectStatus

{
  key   coalesce( _a_dd02b.strucobjn_raw,
              stob.objectname )                                                            as view_name,
        @Search.defaultSearchElement: true
        _src_released.ddlname                                                              as ddl_name,

        coalesce( _a_text_active.ddtext,
                  coalesce( _a_text_active_def.ddtext,
                            _a_text_fallback.ddtext ) )                                    as view_text,

        @ObjectModel.foreignKey.association: '_SourceOrigin'
        cast( _src_released.source_origin as aps_ccv_source_origin preserving type)        as source_origin,

        @ObjectModel.readOnly: true
        @Search: { defaultSearchElement: false }
        _Rework.HighestPriority                                                            as TaskPriorityId,

        @Search: { defaultSearchElement: false }
        @EndUserText.label: 'Task Priority'
        @ObjectModel: { foreignKey.association: '_TaskPriority', readOnly: true }
        @Consumption.valueHelpDefinition: [{entity: {name: 'I_CCV_REWORK_TASK_PRIORITY_VH', element: 'Description' } }]      
        _Rework.HighestPriorityText                                                        as TaskPriority,

        @ObjectModel.readOnly: true
        @Search: { defaultSearchElement: false }
        _Rework.HighestPrioritySortOrder                                                   as TaskPrioritySortOrder,

        @ObjectModel.readOnly: true
        @Search: { defaultSearchElement: false }
        @EndUserText.label: 'Rework'
        @Consumption.filter : { selectionType: #SINGLE,  multipleSelections : false}
        cast( coalesce( _Rework.ReworkIndicator, '' )  as aps_ccv_rework_ind preserving type )              as ReworkIndicator,
        @ObjectModel.readOnly: true
        @Search: { defaultSearchElement: false }
        _Rework.Category                                                                      as Category,
        @ObjectModel.readOnly: true
        @Search: { defaultSearchElement: false }
        @Consumption.valueHelpDefinition: [{entity: {name: 'I_CCV_REWORK_TASK_CATEGORY_VH', element: 'Description' } }]      
        _Rework.CategoryText                                                               as TaskCategory,

        @ObjectModel.foreignKey.association: '_ObjectStatus'
        case
         when _released_for_c1_or_group.state = 'RELEASED' then
            cast ('1' as aps_ccv_object_status)
         when _released_for_c1_or_group.state = 'DEPRECATED' then
            cast ('2' as aps_ccv_object_status)
         else
            ''
         end                                                                               as ObjectStatus,

        @ObjectModel.foreignKey.association: '_AccessProtection'
        case
          when _a_dcl_for_entity.dclname is not null and
               _a_dcl_for_entity.dclname <> '' and
               _AclAuthCheck.value is not null and
               _AclAuthCheck.value = '#PRIVILEGED_ONLY' then
            '2'
          when _a_dcl_for_entity.dclname is not null and
               _a_dcl_for_entity.dclname <> '' then
            '1'
            when _a_dcl_for_entity.dclname is null or
               _a_dcl_for_entity.dclname = '' then
            '0'
          else
           ''
        end                                                                                as access_protection, // 0=None, 1=Protected, 2=Privileged Only



        @EndUserText.label: 'Is Text View'
        @Consumption.filter : { selectionType: #SINGLE,  multipleSelections : false}
        case
          when _ObjectModelDatacategoryAnno.value is not null and
               _ObjectModelDatacategoryAnno.value = '#TEXT' then
            cast('X' as boolean)
          else
            cast('' as boolean)
        end                                                                                as text_view_ind, // X, space


        @ObjectModel.foreignKey.association: '_AnaDataCategory'
        //  @Consumption.valueHelpDefinition: [{entity: {name: 'I_CustomCDSViewAnaDataCategory', element: 'AnalyticsDatacategory' } }]

        case
         when _AnalyticsDatacategoryAnno.value is null then
            ' '
         when _AnalyticsDatacategoryAnno.value = '#CUBE' then
             '1'
         when _AnalyticsDatacategoryAnno.value = '#DIMENSION' then
            '2'
         else
            ' '
        end                                                                                as analytics_datacategory,

        @EndUserText.label: 'Is Masterdata View'
        @Consumption.filter : { selectionType: #SINGLE,  multipleSelections : false}
        case
         when _AnalyticsDatacategoryAnno.value is not null and
              _AnalyticsDatacategoryAnno.value = '#DIMENSION' then
            cast('X' as boolean)
          else
            cast('' as boolean)
        end                                                                                as masterdata_view_ind,

        @EndUserText.label: 'Is Modeling Data Source'
        @Consumption.filter : { selectionType: #SINGLE,  multipleSelections : false}
        case
         when _ModelingDataSourceAnno.value is not null then
            cast('X' as boolean)
          else
            cast('' as boolean)
        end                                                                                as modeling_data_source_ind,

        @EndUserText.label: 'Is Modeling Association Target'
        @Consumption.filter : { selectionType: #SINGLE,  multipleSelections : false}
        case
         when _ModelingAssocTargetAnno.value is not null then
            cast('X' as boolean)
          else
            cast('' as boolean)
        end                                                                                as modeling_assoc_target_ind,

        @ObjectModel: { readOnly: true, virtualElement : true,
                   filter.transformedBy: 'ABAP:CL_CCV_CURRENTSCENARIO_TR_EXIT'
        }
        @Consumption.filter.hidden: true
        cast('' as aps_ccv_scenario)                                                       as current_scenario,

        @Consumption.filter : { selectionType: #SINGLE,  multipleSelections : false}
        cast( case when node_info.with_parameters = 'X' then 'X' else '' end as boolean ) as has_parameter_ind,


        // ABAP:CL_CCV_TR_EXIT_DS_VH_DRAFTIND ensures that no extensibility drafts are shown

        @ObjectModel: {
          readOnly: true,
          virtualElement: true,
          filter.transformedBy: 'ABAP:CL_CCV_TR_EXIT_DS_VH_DRAFTIND'
        }
        @Consumption.filter.hidden: true
        cast(' ' as boolean)                                                               as extensibility_draft_ind,

        //Text and Fuzzy Search

        _a_dd02b.strucobjn_raw                                                             as view_name_camel_case, //name camel case

        stob.objectname                                                                    as view_name_upper_case, //name upper case

        _a_text_active.ddtext                                                              as view_text_a_tx, // text active

        _a_text_active_def.ddtext                                                          as view_text_a_df, // default active

        _a_text_fallback.ddtext                                                            as view_text_fb,   // fallback


        //Associations

        _SourceOrigin,
        _AccessProtection,
        _AnaDataCategory,
        _ObjectStatus,

        _Rework,
        _Rework._TaskPriority                                                                 as _TaskPriority,
        _Rework._TaskCategory                                                                 as _TaskCategory
}

where
         stob.objecttype         = 'STOB'
  and    stob.state              = 'A'
  and
  // but do not show analytical queries

  (
         _AnaQueryAnno.name      is null
    or   _AnaQueryAnno.value     = 'false'
  )
  // custom CDS views without OData + non Custom CDS Views with and without OData

  and(
         _src_released.source_origin != 1
    or(
         _OdataPublishAnno.name  is null
      or _OdataPublishAnno.value = 'false'
    )
  );
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"APS_V_GKE_DDL_MAX_DATE",
"ARS_APIS_RELEASED_C1_OR_GROUPS",
"DDL_OBJECT_NAMES",
"I_CUSTOMCDSVIEWREWORK_KEYUPPER",
"SACM_PUBLIC_DCL_FOR_ENTITY",
"DD02B",
"DD02BND",
"DDDDLSRC",
"DDDDLSRC02BT",
"DDDDLSRCT",
"DDHEADANNO",
"DDLDEPENDENCY"
],
"ASSOCIATED":
[
"I_CCV_REWORK_TASK_CATEGORY_VH",
"I_CCV_REWORK_TASK_PRIORITY_VH",
"I_CUSTOMCDSVIEWACCPROTECTION",
"I_CUSTOMCDSVIEWANADATACATEGORY",
"I_CUSTOMCDSVIEWOBJECTSTATUS",
"I_CUSTOMCDSVIEWREWORK_KEYUPPER",
"I_CUSTOMCDSVIEWSOURCEORIGIN"
],
"BASE":
[
"I_CUSTOMCDSVIEWREWORK_KEYUPPER"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/