R_Sitn2ObjStructureCDSVH is a Composite CDS View that provides data about "Situation Object Structure" in SAP S/4HANA. It reads from 4 data sources (ARS_APIS_RELEASED_FOR_C1, ARS_APIS_RELEASED_C1_OR_GROUPS, ddddlsrc, ddddlsrc) and exposes 4 fields with key field SitnObjStrucName.
@AccessControl.authorizationCheck: #NOT_REQUIRED@ObjectModel:{ usageType:{
serviceQuality:#C,
sizeCategory: #L,
dataClass: #MASTER
},
dataCategory: #VALUE_HELP
}
@VDM.lifecycle.contract.type:#SAP_INTERNAL_API@VDM.viewType: #COMPOSITE@Metadata.ignorePropagatedAnnotations: true@EndUserText.label: 'Situation Object Structure'
defineviewentity R_Sitn2ObjStructureCDSVH
//CDS views that have a C1 contract (either from SAP or Customers)
asselectfrom ARS_APIS_RELEASED_FOR_C1 as apis
innerjoin ddddlsrc on apis.tadir_obj_name = ddddlsrc.ddlname
and apis.tadir_object = 'DDLS'
and apis.object_type = 'CDS_STOB'
leftouter to one join ddddlsrct on apis.tadir_obj_name = ddddlsrct.ddlname
and ddddlsrct.ddlanguage = $session.system_language
{
keycast ( ddddlsrc.ddlname as ddstrucobjname ) as SitnObjStrucName,
cast ( '01' as sit2_de_obj_str_contract_type preserving type ) as SitnObjStrucContractType, // Contract
ddddlsrct.ddtext as SitnObjStrucDescription
}
where
ddddlsrc.as4local = 'A' //Activation state of the object (Entry was activated or generated in this form)
and(
ddddlsrc.source_type = 'V' //Viewor ddddlsrc.source_type = 'W' //ViewEntityor ddddlsrc.source_type = 'P' //Projection View
)
and ddddlsrc.parentname = '' //CDS viewisnot extension viewand ddddlsrc.source_origin = 0 //ABAP Development Tools
and apis.state = 'RELEASED'
union// CDS views that are part of a release group (Custom CDS builder)
selectfrom ARS_APIS_RELEASED_C1_OR_GROUPS as apis
innerjoin ddddlsrc on apis.tadir_obj_name = ddddlsrc.ddlname
and apis.tadir_object = 'DDLS'
and apis.object_type = 'CDS_STOB'
leftouter to one join ddddlsrct on apis.tadir_obj_name = ddddlsrct.ddlname
and ddddlsrct.ddlanguage = $session.system_language
{
keycast ( ddddlsrc.ddlname as ddstrucobjname ) as SitnObjStrucName,
cast ( '02' as sit2_de_obj_str_contract_type preserving type ) as SitnObjStrucContractType, // Release group
ddddlsrct.ddtext as SitnObjStrucDescription
}
where
ddddlsrc.as4local = 'A'
and(
ddddlsrc.source_type = 'V'
or ddddlsrc.source_type = 'W'
or ddddlsrc.source_type = 'P'
)
and ddddlsrc.parentname = ''
and ddddlsrc.source_origin = 1 // Custom View Builder
and apis.state = 'RELEASED' // Views from release group are listed as "released" even though they have no C1 contract
//union//// CDS views that just have the PUBLIC_LOCAL_API annotation, but no contract
//selectfrom ddddlsrc
// innerjoin ddheadanno on ddheadanno.strucobjn = ddddlsrc.ddlname
// and ddheadanno.name = 'VDM.LIFECYCLE.CONTRACT.TYPE'
// and ddheadanno.value = '#PUBLIC_LOCAL_API'
// leftouter to one join ddddlsrct on ddddlsrc.ddlname = ddddlsrct.ddlname
// and ddddlsrct.ddlanguage = $session.system_language
//
// leftouter to one join ARS_APIS_RELEASED_FOR_C1 as apis on apis.tadir_obj_name = ddddlsrc.ddlname
// and apis.tadir_object = 'DDLS'
// and apis.object_type = 'CDS_STOB'
// and apis.state = 'RELEASED'
//
//{
// keycast ( ddddlsrc.ddlname as ddstrucobjname ) as SitnObjStrucName,
// cast ( '03' as sit2_de_obj_str_contract_type preserving type ) as SitnObjStrucContractType, // Annotation (only)
// ddddlsrct.ddtext as SitnObjStrucDescription
//}
//where// ddddlsrc.as4local = 'A'
// and(
// ddddlsrc.source_type = 'V'
// or ddddlsrc.source_type = 'W'
// or ddddlsrc.source_type = 'P'
// )
// and ddddlsrc.parentname = ''
// and ddddlsrc.source_origin = 0 // Only ADT, custom view builder does not support header annotations
// and apis.state isnull/*+[internal] {
"BASEINFO":
{
"FROM":
[
"ARS_APIS_RELEASED_C1_OR_GROUPS",
"ARS_APIS_RELEASED_FOR_C1",
"DDDDLSRC",
"DDDDLSRCT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/