I_APS_COM_CS_CSMPT_D

DDL: I_APS_COM_CS_CSMPT_D SQL: I_APS_CM_CSMPT_D Type: view_entity Package: SR_APS_COM_CSCN_D

Custom Communication Scenarios

I_APS_COM_CS_CSMPT_D is a CDS View that provides data about "Custom Communication Scenarios" in SAP S/4HANA. It reads from 9 data sources and exposes 25 fields with key field CommScenID. It has 4 associations to related views. Part of development package SR_APS_COM_CSCN_D.

Data Sources (9)

SourceAliasJoin Type
ATOV_U_ITEMS_EXPORTED_AT _Exported left_outer
aps_user_ddl _User left_outer
APS_COM_CSCN_API_ROOT application from
aps_com_c_cscn aps_com_c_cscn left_outer
aps_com_cs_ca_c aps_com_cs_ca_c left_outer
aps_com_d_cscn aps_com_d_cscn left_outer
aps_com_w_wl_prt aps_com_w_wl_prt left_outer
ato_setup setup left_outer
usr05 user05 left_outer

Associations (4)

CardinalityTargetAliasCondition
[0..*] aps_com_cs_ca _AssignedInArrangements _AssignedInArrangements.CommunicationScenario = application.communication_scenario_id
[0..*] I_APS_COM_COMM_CSCNIB_D _InboundServiceAssignment
[0..*] I_APS_COM_COMM_CSCNOB_D _OutboundServiceAssignment
[0..*] I_APS_COM_CS_AUTH_D _AuthorizationAssignments

Annotations (2)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
EndUserText.label Custom Communication Scenarios view

Fields (25)

KeyFieldSource TableSource FieldDescription
KEY CommScenID APS_COM_CSCN_API_ROOT communication_scenario_id
Description APS_COM_CSCN_API_ROOT description
LastChangeTime APS_COM_CSCN_API_ROOT change_timestamp
VTRNumber aps_com_d_cscn vtr_number
VTRStatus aps_com_d_cscn vtr_status
VTRSymptom aps_com_d_cscn vtr_symptom
statusendasStatus
vtr_statusthen4else1endasActualStatus
AllowedCaInstances APS_COM_CSCN_API_ROOT allowed_ca_instances
AssignCount aps_com_cs_ca_c AssignedArrangementCount
ObOAuth2Active APS_COM_CSCN_API_ROOT ob_oauth2_auth
ObOAuth2ClientProfile APS_COM_CSCN_API_ROOT ob_oauth2_client_profile
ObOAuth2ClientProfileDesc aps_com_w_wl_prt description
ObX509Auth APS_COM_CSCN_API_ROOT ob_x509_auth
ObBasicAuth APS_COM_CSCN_API_ROOT ob_basic_auth
ObOAuth1Active APS_COM_CSCN_API_ROOT ob_oauth1_auth
ObNoneAuth APS_COM_CSCN_API_ROOT ob_none_auth
AbapLanguageVersion APS_COM_CSCN_API_ROOT abap_language_version
char11endasObOAuth2Granttype
Exported ATOV_U_ITEMS_EXPORTED_AT exported_at
exported_atthenYelseCendasExportStatus
_InboundServiceAssignment _InboundServiceAssignment
_OutboundServiceAssignment _OutboundServiceAssignment
_AssignedInArrangements _AssignedInArrangements
_AuthorizationAssignments _AuthorizationAssignments
//@AbapCatalog.sqlViewName: 'I_APS_CM_CSMPT_D'

//@AbapCatalog.compiler.compareFilter: true

@AccessControl.authorizationCheck: #CHECK
//@Search.searchable: true

@EndUserText.label: 'Custom Communication Scenarios'
//@AbapCatalog.preserveKey: true

//@OData.publish: true


//@ObjectModel.writeEnabled: true

//@ObjectModel.createEnabled:true

//@ObjectModel.deleteEnabled:true

//@ObjectModel.updateEnabled:true



define root view entity I_APS_COM_CS_CSMPT_D
  as select from    APS_COM_CSCN_API_ROOT    as application
  // Count arrangements

    left outer join aps_com_cs_ca_c                       on aps_com_cs_ca_c.CommunicationScenario = application.communication_scenario_id

  //Join to the status of the scenario

    left outer join aps_com_d_cscn                        on aps_com_d_cscn.communication_scenario_id = application.communication_scenario_id

    left outer join aps_com_w_wl_prt                      on  aps_com_w_wl_prt.profile = application.ob_oauth2_client_profile
                                                          and aps_com_w_wl_prt.langu   = $session.system_language

    left outer join aps_user_ddl             as _User     on _User.UserID = application.change_user

    left outer join usr05                    as user05    on  user05.bname = $session.user
    //                                                                  and user05.mandt = $session.client

                                                          and user05.parid = 'ATO_TEST_SERVICE'

    left outer join ATOV_U_ITEMS_EXPORTED_AT as _Exported on  _Exported.item_id   = application.communication_scenario_id
                                                          and _Exported.item_type = 'COM_SCN'

    left outer join aps_com_c_cscn                        on application.communication_scenario_id = aps_com_c_cscn.communication_scenario_id

    left outer join ato_setup                as setup     on 1 = 1 //on setup.client = $session.client


  // Association to assigned catalogs

  composition [0..*] of I_APS_COM_COMM_CSCNIB_D as _InboundServiceAssignment //on _InboundServiceAssignment.CommScenID = $projection.CommScenID

  composition [0..*] of I_APS_COM_COMM_CSCNOB_D as _OutboundServiceAssignment //on _OutboundServiceAssignment.CommScenID = $projection.CommScenID

  association [0..*] to aps_com_cs_ca           as _AssignedInArrangements on _AssignedInArrangements.CommunicationScenario = application.communication_scenario_id
  composition [0..*] of I_APS_COM_CS_AUTH_D     as _AuthorizationAssignments //on _AuthorizationAssignments.ScenarioId = $projection.CommScenID


{
      @UI.facet: [{ id: 'InboundServices',
      purpose: #STANDARD,
      label: 'Inbound Services',
      type: #LINEITEM_REFERENCE,
      targetElement: '_InboundServiceAssignment',
      position: 2},
      { id: 'Authorizations',
      purpose: #STANDARD,
      label: 'Authorizations',
      type: #LINEITEM_REFERENCE,
      targetElement: '_AuthorizationAssignments',
      position: 3}
      ]

      //@Search:{ defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }

  key application.communication_scenario_id    as CommScenID,

      //@ObjectModel.readOnly: true

      application.description                  as Description,

      //@ObjectModel.readOnly: true

      @Consumption.filter.hidden : true
      application.change_timestamp             as LastChangeTime,

      //@ObjectModel.readOnly: true

      //_User.UserDescription                                                as LastChangedBy,

      case
        when setup.ext_dev_system = 'X' then _User.UserDescription
        when user05.parva = 'X' then _User.UserDescription
        else 'SYSTEM'
        end                                    as LastChangedBy,

      //@ObjectModel.readOnly: true

      @Consumption.filter.hidden : true
      aps_com_d_cscn.vtr_number                as VTRNumber,

      //@ObjectModel.readOnly: true

      @Consumption.filter.hidden : true
      aps_com_d_cscn.vtr_status                as VTRStatus,

      //@ObjectModel.readOnly: true

      @Consumption.filter.hidden : true
      aps_com_d_cscn.vtr_symptom               as VTRSymptom,

      //@ObjectModel.readOnly: true

      @Consumption.filter.hidden : true
      case
      when aps_com_d_cscn.status is null then 'X'
      else aps_com_d_cscn.status
      end                                      as Status,


      case
        when (aps_com_d_cscn.status is null or aps_com_d_cscn.status = 'P') and (aps_com_d_cscn.vtr_number='' or aps_com_d_cscn.vtr_number is null) then 2 // Published

      //when aps_com_d_cscn.status = 'U' and aps_com_d_cscn.vtr_number = '' then 1

        when aps_com_d_cscn.destination_status = 'U' or aps_com_d_cscn.destination_status = '' then 1 // Unpublished

        when aps_com_d_cscn.vtr_number != '' and aps_com_d_cscn.vtr_status = '' then 3 // Publishing

        when aps_com_d_cscn.vtr_status != '' then 4 // Rejected

        else 1
      end                                      as ActualStatus,

      application.allowed_ca_instances         as AllowedCaInstances,

      //@ObjectModel.readOnly: true

      @Consumption.filter.hidden : true
      aps_com_cs_ca_c.AssignedArrangementCount as AssignCount,


      application.ob_oauth2_auth               as ObOAuth2Active,
      application.ob_oauth2_client_profile     as ObOAuth2ClientProfile,
      aps_com_w_wl_prt.description             as ObOAuth2ClientProfileDesc,

      application.ob_x509_auth                 as ObX509Auth,
      application.ob_basic_auth                as ObBasicAuth,
      application.ob_oauth1_auth               as ObOAuth1Active,
      application.ob_none_auth                 as ObNoneAuth,

      application.abap_language_version        as AbapLanguageVersion,

      case
              when application.ob_oauth2_granttype = 0 then ''
              else cast(application.ob_oauth2_granttype as abap.char(11))
              end                              as ObOAuth2Granttype,

      //            case

      //               when _Exported.exported_at = 0 then cast( 0 as abap.dec(15,0))

      //               when _Exported.exported_at is null then cast( 0 as abap.dec(15,0))

      //               else _Exported.exported_at

      //               end as Exported,

      //      cast( 0 as abap.dec(15,0))               as Exported,

      _Exported.exported_at                    as Exported,

      case
        when _Exported.exported_at is null then 'N'
        when application.change_timestamp < _Exported.exported_at then 'Y'
        else 'C'
        end                                    as ExportStatus,


      _InboundServiceAssignment,
      _OutboundServiceAssignment,
      _AssignedInArrangements,
      _AuthorizationAssignments

}
where
       application.communication_scenario_id   not like 'SAP_%'
  and  application.communication_scenario_type = '1' //#APS_COM_CSCN_TYPE.'1'


  and // Customer Managed Scenarios

  (
       application.scope_dependent             = ''
    or aps_com_c_cscn.scope_state              = '3' //#APS_BC_SCOPE_STATE.'3'

  ) // In Scope or NOT scope dependent