DDCDS_LIST_DIRECT_BASE_ENTITY

DDL: DDCDS_LIST_DIRECT_BASE_ENTITY SQL: DDCDS_E_DBE Type: view

List direct base entities

DDCDS_LIST_DIRECT_BASE_ENTITY is a CDS View that provides data about "List direct base entities" in SAP S/4HANA. It reads from 10 data sources and exposes 4 fields with key fields entity_name, state, state, state.

Data Sources (10)

SourceAliasJoin Type
dd2526v dd2526v inner
dd2526v dd2526v inner
ddcds_fromclause from_clause from
ddldependency stob_dep union
ddldependency stob_dep union
ddldependency stob_dep_dbo inner
ddldependency stob_dep_dbo inner
ddldependency view_dep inner
ddldependency view_dep inner
ddldependency view_dep_dbo inner

Annotations (4)

NameValueLevelField
AbapCatalog.sqlViewName DDCDS_E_DBE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label List direct base entities view

Fields (4)

KeyFieldSource TableSource FieldDescription
KEY entity_name Entity Name(Uppercase)
KEY state Entity State
KEY state Entity State
KEY state Entity State
@AbapCatalog.sqlViewName: 'DDCDS_E_DBE'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'List direct base entities'
// ***********************************************************************************************************//

// This view list the direct base entities of a CDS entity which are part of select from or used in the 

// Assoc path propagation. Tables used as direct base object are ignored here. 

// ***********************************************************************************************************//


define view DDCDS_LIST_DIRECT_BASE_ENTITY
  // ***********************************************************************************************************//

  // -1- CDS V2 Entities with V1 and V2 as base entites

  // ***********************************************************************************************************//

  as select from ddcds_fromclause as from_clause
{
      @EndUserText.label: 'Entity Name(Uppercase)'
  key cast(from_clause.entity_name                     as abap.char(30)) as entity_name,
      @EndUserText.label: 'Entity State'
  key cast(from_clause.as4local                        as abap.char(1))  as state,
      @EndUserText.label: 'Direct Base Entity Name(Uppercase)'
      cast(from_clause.base_obj_name                   as abap.char(30)) as direct_base_entity_name
}
where
      from_clause.parameter_name = 'DIRECT_BASE_OBJECT'
  and from_clause.base_obj_type  = 'STOB'
  and from_clause.as4local       = 'A'

// ***********************************************************************************************************//

// -2- CDS V1 Views with V1 as base entities

// ***********************************************************************************************************//


union select from ddldependency as stob_dep
  inner join      ddldependency as view_dep     on  view_dep.objecttype = 'VIEW'
                                                and view_dep.ddlname    = stob_dep.ddlname
                                                and view_dep.state      = stob_dep.state
  inner join      dd2526v       as dd2526v      on  dd2526v.viewname = view_dep.objectname
                                                and dd2526v.as4local = stob_dep.state

  inner join      ddldependency as view_dep_dbo on  view_dep_dbo.objecttype = 'VIEW'
                                                and view_dep_dbo.objectname = dd2526v.tabname
                                                and view_dep_dbo.state      = dd2526v.as4local
  inner join      ddldependency as stob_dep_dbo on  stob_dep_dbo.objecttype = 'STOB'
                                                and stob_dep_dbo.ddlname    = view_dep_dbo.ddlname
                                                and stob_dep_dbo.state      = view_dep_dbo.state
{

      @EndUserText.label: 'Entity Name(Uppercase)'
  key cast(stob_dep.objectname                           as abap.char(30)) as entity_name,
      @EndUserText.label: 'Entity State'
  key cast(stob_dep.state                                as abap.char(1))  as state,
      @EndUserText.label: 'Direct Base Entity Name(Uppercase)'
      cast(stob_dep_dbo.objectname    as abap.char(30))                    as direct_base_entity_name
}
where
      stob_dep.objecttype = 'STOB'
  and stob_dep.state      = 'A'

// ***********************************************************************************************************//

// -3- CDS V1 Views on top of V2 Entities e.g. View on View Entity or View on Hierachy

// ***********************************************************************************************************//


union select from ddldependency as stob_dep
  inner join      ddldependency as view_dep     on  view_dep.objecttype = 'VIEW'
                                                and view_dep.ddlname    = stob_dep.ddlname
                                                and view_dep.state      = stob_dep.state
  inner join      dd2526v       as dd2526v      on  dd2526v.viewname = view_dep.objectname
                                                and dd2526v.as4local = stob_dep.state

  inner join      ddldependency as stob_dep_dbo on  stob_dep_dbo.objecttype = 'STOB'
                                                and stob_dep_dbo.objectname = dd2526v.tabname
                                                and stob_dep_dbo.state      = dd2526v.as4local
{

      @EndUserText.label: 'Entity Name(Uppercase)'
  key cast(stob_dep.objectname                           as abap.char(30)) as entity_name,
      @EndUserText.label: 'Entity State'
  key cast(stob_dep.state                                as abap.char(1))  as state,
      @EndUserText.label: 'Direct Base Entity Name(Uppercase)'
      cast(stob_dep_dbo.objectname    as abap.char(30))                    as direct_base_entity_name
}
where
      stob_dep.objecttype = 'STOB'
  and stob_dep.state      = 'A'