P_Cfd_Associable_Cds_View
Associable CDS Views
P_Cfd_Associable_Cds_View is a CDS View that provides data about "Associable CDS Views" in SAP S/4HANA. It reads from 10 data sources and exposes 11 fields with key field ViewName. It has 4 associations to related views. Part of development package S_CFD_REPOSITORY_HANDLER.
Data Sources (10)
| Source | Alias | Join Type |
|---|---|---|
| ddheadanno | analyticsDataCategoryAnno | left_outer |
| ATOV_U_ITEM_KEY | atoItems | left_outer |
| ATOV_SETTINGS | atoSettings | left_outer |
| ddddlsrc | ddlSource | inner |
| dd02b | entity | inner |
| P_Cfd_Associable_Cds_View_Keys | keyFields | left_outer |
| ddheadanno | objectModelDataCategoryAnno | left_outer |
| ddheadanno | objectModelQueryImplemented | left_outer |
| dd10b | parameters | left_outer |
| ARS_APIS_RELEASED_C1_OR_GROUPS | releasedObjects | left_outer |
Associations (4)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | P_Cfd_Cds_Source_Origin | _sourceOrigin | _sourceOrigin.Code = $projection.SourceOrigin |
| [0..1] | ddddlsrc02bt | _viewLabelCurrentLanguage | _viewLabelCurrentLanguage.ddlname = ddlSource.ddlname and _viewLabelCurrentLanguage.strucobjn = stob.objectname and _viewLabelCurrentLanguage.as4local = stob.state and _viewLabelCurrentLanguage.ddlanguage = $session.system_language |
| [0..1] | ddddlsrc02bt | _viewLabelFallbackLanguage | _viewLabelFallbackLanguage.ddlname = ddlSource.ddlname and _viewLabelFallbackLanguage.strucobjn = stob.objectname and _viewLabelFallbackLanguage.as4local = stob.state and _viewLabelFallbackLanguage.ddlanguage = 'E' |
| [0..1] | ddddlsrct | _viewDescriptionFallback | _viewDescriptionFallback.ddlname = ddlSource.ddlname and _viewDescriptionFallback.as4local = stob.state and _viewDescriptionFallback.ddlanguage = $session.system_language |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_ALLOWED | view | |
| EndUserText.label | Associable CDS Views | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #S | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (11)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | ViewName | stob | objectname | |
| ViewNameCamelCase | dd02b | strucobjn_raw | ||
| ddtextasViewDescription | ||||
| SourceOrigin | ||||
| source_typeQthenXelseendasIsCustomEntity | ||||
| NumberOfKeys | ||||
| CustomEntityImplementation | ddheadanno | value | ||
| ViewDescriptionCurrentLanguage | _viewLabelCurrentLanguage | ddtext | ||
| ViewDescriptionFallbackLang | _viewLabelFallbackLanguage | ddtext | ||
| ViewDescriptionFallback | _viewDescriptionFallback | ddtext | ||
| _sourceOrigin | _sourceOrigin |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_ALLOWED
@EndUserText.label: 'Associable CDS Views'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity P_Cfd_Associable_Cds_View
as select distinct from ddldependency as stob
inner join ddddlsrc as ddlSource on ddlSource.ddlname = stob.ddlname
and (
ddlSource.source_type = 'V'
or ddlSource.source_type = 'W'
or ddlSource.source_type = 'Q'
)
and ddlSource.as4local = stob.state
and ddlSource.parentname = ''
inner join dd02b as entity on entity.strucobjn = stob.objectname
and entity.as4local = stob.state
left outer join ATOV_SETTINGS as atoSettings on atoSettings.client = $session.client
left outer join ATOV_U_ITEM_KEY as atoItems on atoItems.item_id = stob.ddlname
and atoItems.item_type = 'CKE'
left outer join ARS_APIS_RELEASED_C1_OR_GROUPS as releasedObjects on releasedObjects.object_key = stob.objectname
and releasedObjects.object_type = 'CDS_STOB'
and releasedObjects.state = 'RELEASED'
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 objectModelQueryImplemented on objectModelQueryImplemented.strucobjn = stob.objectname
and objectModelQueryImplemented.name = 'OBJECTMODEL.QUERY.IMPLEMENTEDBY'
left outer join dd10b as parameters on parameters.strucobjn = stob.objectname
and parameters.as4local = 'A'
left outer join P_Cfd_Associable_Cds_View_Keys as keyFields on keyFields.ViewName = stob.objectname
association [0..1] to P_Cfd_Cds_Source_Origin as _sourceOrigin on _sourceOrigin.Code = $projection.SourceOrigin
association [0..1] to ddddlsrc02bt as _viewLabelCurrentLanguage on _viewLabelCurrentLanguage.ddlname = ddlSource.ddlname
and _viewLabelCurrentLanguage.strucobjn = stob.objectname
and _viewLabelCurrentLanguage.as4local = stob.state
and _viewLabelCurrentLanguage.ddlanguage = $session.system_language
association [0..1] to ddddlsrc02bt as _viewLabelFallbackLanguage on _viewLabelFallbackLanguage.ddlname = ddlSource.ddlname
and _viewLabelFallbackLanguage.strucobjn = stob.objectname
and _viewLabelFallbackLanguage.as4local = stob.state
and _viewLabelFallbackLanguage.ddlanguage = 'E'
// 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 _viewDescriptionFallback on _viewDescriptionFallback.ddlname = ddlSource.ddlname
and _viewDescriptionFallback.as4local = stob.state
and _viewDescriptionFallback.ddlanguage = $session.system_language
{
key stob.objectname as ViewName,
entity.strucobjn_raw as ViewNameCamelCase,
coalesce( _viewLabelCurrentLanguage.ddtext,
coalesce( _viewLabelFallbackLanguage.ddtext,
_viewDescriptionFallback.ddtext ) ) as ViewDescription,
cast( ddlSource.source_origin as abap.char( 3 ) ) as SourceOrigin, // must match type (char) of text association to DD07L-DOMVALUE_L, but length (3) of DDDDLSRC-SOURCE_ORIGIN
case
when analyticsDataCategoryAnno.value is not null and
analyticsDataCategoryAnno.value = '#DIMENSION'
then 'X'
else ''
end as IsMasterdataView,
case
when objectModelDataCategoryAnno.value is not null and
objectModelDataCategoryAnno.value = '#VALUE_HELP'
then 'X'
else ''
end as IsValueHelpView,
case
when ddlSource.source_type = 'Q'
then 'X'
else ''
end as IsCustomEntity,
case
when parameters.strucobjn is not null
then 'X'
else ''
end as HasParameters,
count( distinct keyFields.FieldName ) as NumberOfKeys,
objectModelQueryImplemented.value as CustomEntityImplementation,
//Text and Fuzzy Search
_viewLabelCurrentLanguage.ddtext as ViewDescriptionCurrentLanguage,
_viewLabelFallbackLanguage.ddtext as ViewDescriptionFallbackLang,
_viewDescriptionFallback.ddtext as ViewDescriptionFallback,
_sourceOrigin
}
where
stob.objecttype = 'STOB'
and stob.state = 'A'
and ddlSource.source_origin = 0 // ADT
and ( ddlSource.abap_language_version <> '5' // no developer extensibility
or ddlSource.source_type = 'Q' // except custom entities
or atoSettings.setup_type = 'P' ) // except in OnPrem/Private Cloud
and releasedObjects.object_key is not null // C1 release
or ddlSource.source_origin = 1 // CustomCdsView
and atoItems.item_id is not null // no draft
group by
stob.objectname,
entity.strucobjn_raw,
_viewLabelCurrentLanguage.ddtext,
_viewLabelFallbackLanguage.ddtext,
_viewDescriptionFallback.ddtext,
ddlSource.source_origin,
analyticsDataCategoryAnno.value,
objectModelDataCategoryAnno.value,
objectModelQueryImplemented.value,
ddlSource.source_type,
parameters.strucobjn
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA