APS_V_GKE_VIEW_LIST_INACTIVE

DDL: APS_V_GKE_VIEW_LIST_INACTIVE SQL: APS_V_CKE_VLI Type: view

List of inactive Custom CDS views

APS_V_GKE_VIEW_LIST_INACTIVE is a CDS View that provides data about "List of inactive Custom CDS views" in SAP S/4HANA. It reads from 8 data sources and exposes 9 fields with key field ddl_name. It has 6 associations to related views.

Data Sources (8)

SourceAliasJoin Type
ddheadanno _AclAuthCheck left_outer
ddheadanno _AnalyticsDatacategoryAnno left_outer
DDL_OBJECT_NAMES _ddl_obj_names_for_stob left_outer
DDL_OBJECT_NAMES _ddl_obj_names_for_view left_outer
Sacm_Public_Dcl_For_Entity _j_dcl_for_entity left_outer
aps_cke_draft _j_draft left_outer
APS_V_GKE_DDL_MAX_DATE _j_maxdate_inactive inner
ddheadanno _OdataPublishAnno left_outer

Parameters (1)

NameTypeDefault
p_ato_allows_changes boolean

Associations (6)

CardinalityTargetAliasCondition
[0..1] dd02b _a_dd02b _a_dd02b.strucobjn = _ddl_obj_names_for_stob.CDS_DB_VIEW and _a_dd02b.as4local = _j_maxdate_inactive.max_ddl_state
[0..1] dd25l _a_prop_view _a_prop_view.viewname = _ddl_obj_names_for_view.CDS_DB_VIEW and _a_prop_view.as4local = _ddl_obj_names_for_view.STATE and _a_prop_view.as4vers = '0000'
[0..1] I_User _a_user21 _a_user21.UserID = _src_inactive.as4user
[0..1] ddddlsrc02bt _a_text_inactive _a_text_inactive.ddlname = _src_inactive.ddlname and _a_text_inactive.as4local = 'N' and _a_text_inactive.ddlanguage = $session.system_language
[0..1] ddddlsrc02bt _a_text_inactive_def _a_text_inactive_def.ddlname = _src_inactive.ddlname and _a_text_inactive_def.as4local = 'N' and _a_text_inactive_def.ddlanguage = 'E'
[0..1] ddddlsrct _a_text_inactive_fb _a_text_inactive_fb.ddlname = _src_inactive.ddlname and _a_text_inactive_fb.as4local = 'N' and _a_text_inactive_fb.ddlanguage = $session.system_language

Annotations (3)

NameValueLevelField
AbapCatalog.sqlViewName APS_V_CKE_VLI view
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label List of inactive Custom CDS views view

Fields (9)

KeyFieldSource TableSource FieldDescription
KEY ddl_name _src_inactive ddlname
CDS_ENTITYasview_name
valuetruethenXelseendasodata_publish_ind
rework
ddl_state APS_V_GKE_DDL_MAX_DATE max_ddl_state
view_name_1 _a_dd02b strucobjn_raw
view_name_2 DDL_OBJECT_NAMES CDS_ENTITY
user_draft _src_inactive as4user
view_text_fb _a_text_inactive_fb ddtext
@AbapCatalog.sqlViewName: 'APS_V_CKE_VLI'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'List of inactive Custom CDS views'
@AbapCatalog.dbHints: [{dbSystem: #HDB, hint: 'OPTIMIZATION_LEVEL(MINIMAL_COST_BASED)'}]
define view APS_V_GKE_VIEW_LIST_INACTIVE
  with parameters
    p_ato_allows_changes :boolean

  as select distinct from ddddlsrc                                              as _src_inactive

    inner join APS_V_GKE_DDL_MAX_DATE                                           as _j_maxdate_inactive    
      on  _j_maxdate_inactive.ddl_name = _src_inactive.ddlname
      and _j_maxdate_inactive.min_ddl_state = 'N'
    left outer join aps_cke_draft                                               as _j_draft              
      on _j_draft.draft_name = _src_inactive.ddlname
    left outer join DDL_OBJECT_NAMES                                            as _ddl_obj_names_for_view   // to get a db view...           

      on  _ddl_obj_names_for_view.CDS_DDL    = _src_inactive.ddlname
      and _ddl_obj_names_for_view.STATE      = _j_maxdate_inactive.max_ddl_state
    left outer join Sacm_Public_Dcl_For_Entity                                  as _j_dcl_for_entity 
      on _j_dcl_for_entity.entity = _src_inactive.ddlname
    left outer join DDL_OBJECT_NAMES                                            as _ddl_obj_names_for_stob               
      on  _ddl_obj_names_for_stob.CDS_DDL    = _src_inactive.ddlname
      and _ddl_obj_names_for_stob.STATE      = _j_maxdate_inactive.max_ddl_state
    left outer join ddheadanno as _OdataPublishAnno
      on _OdataPublishAnno.strucobjn = _ddl_obj_names_for_stob.CDS_ENTITY 
      and _OdataPublishAnno.name = 'ODATA.PUBLISH'
    left outer join ddheadanno as _AnalyticsDatacategoryAnno
      on _AnalyticsDatacategoryAnno.strucobjn = _ddl_obj_names_for_stob.CDS_ENTITY 
      and _AnalyticsDatacategoryAnno.name = 'ANALYTICS.DATACATEGORY'
    left outer join ddheadanno                                                  as _AclAuthCheck
      on _AclAuthCheck.strucobjn = _ddl_obj_names_for_stob.CDS_ENTITY   
      and _AclAuthCheck.name = 'ACCESSCONTROL.AUTHORIZATIONCHECK'
    
  association [0..1] to dd02b                                                   as _a_dd02b               
    on  _a_dd02b.strucobjn = _ddl_obj_names_for_stob.CDS_DB_VIEW
    and _a_dd02b.as4local  = _j_maxdate_inactive.max_ddl_state                                                        
  association [0..1] to dd25l                                                   as _a_prop_view          
    on  _a_prop_view.viewname = _ddl_obj_names_for_view.CDS_DB_VIEW 
    and _a_prop_view.as4local = _ddl_obj_names_for_view.STATE
    and _a_prop_view.as4vers  = '0000'
  association [0..1] to I_User                                                   as _a_user21       
    on  _a_user21.UserID = _src_inactive.as4user
  association [0..1] to ddddlsrc02bt                                            as _a_text_inactive          
    on  _a_text_inactive.ddlname    = _src_inactive.ddlname
    and _a_text_inactive.as4local   = 'N'
    and _a_text_inactive.ddlanguage = $session.system_language
  association [0..1] to ddddlsrc02bt                                            as _a_text_inactive_def 
    on  _a_text_inactive_def.ddlname    = _src_inactive.ddlname
    and _a_text_inactive_def.as4local   = 'N'
    and _a_text_inactive_def.ddlanguage = 'E'
  association [0..1] to ddddlsrct                                               as _a_text_inactive_fb  // fallback   

    on  _a_text_inactive_fb.ddlname    = _src_inactive.ddlname
    and _a_text_inactive_fb.as4local   = 'N'
    and _a_text_inactive_fb.ddlanguage = $session.system_language

{
  key _src_inactive.ddlname                                                     as ddl_name,                
  
      :p_ato_allows_changes                                                     as ato_allows_changes,      
      
      // --------------------------------------------------------------------------------------------------------

      // UI fields (standard)

      // --------------------------------------------------------------------------------------------------------

  
      coalesce( _a_dd02b.strucobjn_raw, 
                _ddl_obj_names_for_stob.CDS_ENTITY )                            as view_name,           
    
      coalesce( _a_text_inactive.ddtext, 
                coalesce( _a_text_inactive_def.ddtext, 
                          _a_text_inactive_fb.ddtext ) )                        as view_text,               
    
      '6'                                                                       as object_status,
      cast(_src_inactive.source_origin as abap.char(3))                         as source_origin,           
      
      // --------------------------------------------------------------------------------------------------------

      // UI fields (enhanced/personalized)

      // --------------------------------------------------------------------------------------------------------


      '00000000000000'                                                          as last_published_at, 
      ''                                                                        as last_published_by,
      :p_ato_allows_changes                                                     as changeable_ind, 
      'N'                                                                       as transport_state,
      'X'                                                                       as draft_exists_ind,
      
      case 
        when _a_prop_view.with_parameters = 'X' then 
          'X' 
        else 
          ' ' 
      end                                                                       as has_parameter_ind,
      
      case 
        when _j_dcl_for_entity.dclname is not null and
             _j_dcl_for_entity.dclname <> '' and
             _AclAuthCheck.value is not null and
             _AclAuthCheck.value = '#PRIVILEGED_ONLY' then 
          '2' 
        when _j_dcl_for_entity.dclname is not null and
             _j_dcl_for_entity.dclname <> '' then
          '1' 
        else 
          '0' 
      end                                                                       as access_protection,     // 0=None, 1=Protected, 2=Privileged Only

      
      case 
        when _src_inactive.source_origin = 1 and
             _OdataPublishAnno.value is not null and
             _OdataPublishAnno.value = 'true' then
          'X' 
        else 
          ' ' 
      end                                                                       as odata_publish_ind,      // X, space


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

      
      // --------------------------------------------------------------------------------------------------------

      // ATO rework tasks

      // --------------------------------------------------------------------------------------------------------

      ' '                                                                       as rework,
      0                                                                         as rework_priority_aggregated,
      ' '                                                                       as rework_category,
      
      // --------------------------------------------------------------------------------------------------------

      // Deprecated views with successor

      // --------------------------------------------------------------------------------------------------------


      '0'                                                                       as successor_classification,
      ' '                                                                       as successor_view_name,
      ' '                                                                       as successor_ddl_name,

      // --------------------------------------------------------------------------------------------------------

      // Fields that are not used in consumption view, because UI doesn't show it 

      // --------------------------------------------------------------------------------------------------------

    
      case 
        when _a_user21.UserDescription is not null and
             _a_user21.UserDescription <> '' then 
          _a_user21.UserDescription 
        else 
          _src_inactive.as4user 
      end                                                                       as user_name,        
      _j_maxdate_inactive.last_changed_at                                       as last_changed_at,  
      _j_maxdate_inactive.max_ddl_state                                         as ddl_state,            // A, M, N 

    
      // --------------------------------------------------------------------------------------------------------

      // FUZZY SEARCH 

      // --------------------------------------------------------------------------------------------------------

    
      _a_dd02b.strucobjn_raw                                                    as view_name_1,         
      _ddl_obj_names_for_stob.CDS_ENTITY                                        as view_name_2,         

      // ''                                                                     as user_draft_tech,     // user_name - doesn't work with SADL

      _a_user21.UserDescription                                                 as user_draft_tech,     // user_name - workaround for SADL

      // ''                                                                     as user_draft,          // user_name - doesn't work with SADL

      _src_inactive.as4user                                                     as user_draft,          // user_name - workaround for SADL

      _a_user21.UserDescription                                                 as user_inactive_tech,  // user_name

      _src_inactive.as4user                                                     as user_inactive,       // user_name

      // ''                                                                     as user_released_tech,  // user_name, last_published_by - doesn't work with SADL

      _a_user21.UserDescription                                                 as user_released_tech,  // user_name, last_published_by - workaround for SADL

      // ''                                                                     as user_released,       // user_name, last_published_by - doesn't work with SADL

      _src_inactive.as4user                                                     as user_released,       // user_name, last_published_by - workaround for SADL


      // '                                                            '         as view_text_a_tx,      // text active - doesn't work with SADL

      _a_text_inactive.ddtext                                                   as view_text_a_tx,      // text inactive - workaround for SADL

      // '                                                            '         as view_text_a_df,      // default active - doesn't work with SADL

      _a_text_inactive_def.ddtext                                               as view_text_a_df,      // default inactive - workaround for SADL

      
      //_a_text_inactive.ddtext                                                 as view_text_i_tx,      // text inactive

      //_a_text_inactive_def.ddtext                                             as view_text_i_df      // default inactive

      _a_text_inactive_fb.ddtext                                                as view_text_fb         // fallback


}
where
  (
    _src_inactive.source_origin = 1 and
    _src_inactive.as4local = 'N' and
    _j_maxdate_inactive.min_ddl_state = 'N' and
    _j_draft.ddl_name is null
  );   
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"APS_V_GKE_DDL_MAX_DATE",
"DDL_OBJECT_NAMES",
"I_USER",
"SACM_PUBLIC_DCL_FOR_ENTITY",
"APS_CKE_DRAFT",
"DD02B",
"DD25L",
"DDDDLSRC",
"DDDDLSRC02BT",
"DDDDLSRCT",
"DDHEADANNO",
"T000"
],
"ASSOCIATED":
[
"I_USER",
"DD02B",
"DD25L",
"DDDDLSRC02BT",
"DDDDLSRCT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/