Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view I_APS_COM_CS_CSMPT_D.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: I_APS_CM_CSMPT_D
CREATE VIEW I_APS_COM_CS_CSMPT_D AS
SELECT
application.communication_scenario_id AS CommScenID,
application.description AS Description,
application.change_timestamp AS LastChangeTime,
aps_com_d_cscn.vtr_number AS VTRNumber,
aps_com_d_cscn.vtr_status AS VTRStatus,
aps_com_d_cscn.vtr_symptom AS VTRSymptom,
case when aps_com_d_cscn.status is null then 'X' else aps_com_d_cscn.status end as Status AS statusendasStatus,
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 when aps_com_d_cscn.destination_status = 'U' or aps_com_d_cscn.destination_status = '' then 1 when aps_com_d_cscn.vtr_number != '' and aps_com_d_cscn.vtr_status = '' then 3 when aps_com_d_cscn.vtr_status != '' then 4 else 1 end as ActualStatus AS vtr_statusthen4else1endasActualStatus,
application.allowed_ca_instances AS AllowedCaInstances,
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 AS char11endasObOAuth2Granttype,
_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 AS exported_atthenYelseCendasExportStatus
FROM APS_COM_CSCN_API_ROOT AS application
LEFT OUTER JOIN aps_com_cs_ca_c ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN aps_com_d_cscn ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN aps_com_w_wl_prt ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN aps_user_ddl AS _User ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN usr05 AS user05 ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN ATOV_U_ITEMS_EXPORTED_AT AS _Exported ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN aps_com_c_cscn ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN ato_setup AS setup ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN aps_com_cs_ca AS _AssignedInArrangements ON _AssignedInArrangements.CommunicationScenario = application.communication_scenario_id -- association [0..*]
LEFT OUTER JOIN I_APS_COM_COMM_CSCNIB_D AS _InboundServiceAssignment ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN I_APS_COM_COMM_CSCNOB_D AS _OutboundServiceAssignment ON /* condition not available in parsed metadata */ -- association [0..*]
LEFT OUTER JOIN I_APS_COM_CS_AUTH_D AS _AuthorizationAssignments ON /* condition not available in parsed metadata */ -- association [0..*]
;