logo

Are you need IT Support Engineer? Free Consultant

How to extend ABAP Test Cockpit on SAP BTP for cus…

  • By sujay
  • 20/05/2026
  • 11 Views

If you are using the ABAP Test Cockpit (ATC) on SAP BTP already as a central ATC check system for developments in your private cloud or on-premise systems, and have ideas like

  • I want to visualize ATC findings on my own quality dashboard
  • I want to setup approver areas programmatically
  • I want to enhance exemption flow
  • I want to programmatically evaluate ATC findings
  • …. or do something else

then this blog post is for you to guide you which released ATC APIs and CDS views are available for your extension use case.  

If you have any additional use cases in mind, please let us know as comment on this blog post.

 

The released APIs (C1 contract, “For Use in Cloud Development”) for ATC on SAP BTP support different use cases like starting local ATC runs, processing ATC exemptions, configuring ATC approver responsibilities or implementing custom ATC checks.

The single entry point for the released ATC APIs is the class CL_SATC_API. The method CL_SATC_API=>CREATE_API_FACTORY returns a factory object from which specialized subfactories can be instantiated for different use cases. In what follows, whenever a code snippet mentions an object named ATC, it refers to this API factory. We therefore assume:

data(atc) = cl_satc_api=>create_api_factory( ).

The following describes how these APIs support different use cases.

Read ATC results

An ATC run result consists of a header and a list of findings. The headers of an ATC run result are accessible via the CDS view SATC_API_RESULT_HEADERS. The key ResultId is a GUID that uniquely identifies this ATC result. While the header provides general information of the check run (title, completion time), the actual findings are accessible via the CDS view SATC_API_FINDINGS. Findings belong to an ATC run if their ResultId matches the run's header ResultId.

Alternatively, the API factory also offers access to the findings of an ATC run via 

data(result) = atc->get_result_by_id( result_id ).

This approach includes additional information not available through direct CDS view queries, such as the individual texts of the findings.

Start ATC runs

This API allows you to start local ATC runs for transports and object lists. These runs are always synchronous – they execute in the session in which they are started and do not run as background jobs. Results are available only through the API; these runs are not custom code analysis projects and do not appear in the Analyze Custom Code app.

data(objects_to_check) = atc->create_object_set_fr_transport( 'ATCK000001' ).
data(run_config) = atc->create_run_configuration( objects_to_check ).
data(run) = atc->create_run( run_config ).
data(result) = run->run( )->get_findings_with_text( ).

Approve/reject ATC exemptions

Both types of exemptions can be approved or rejected programmatically using the exemption controller:

data(xmpt_controller) = atc->get_exemption_controller( ).
data(ids_and_assessments) = value if_satc_exemption_controller=>ty_exemptions_eval(
  ( exemption_id = exemption_id assessment = `Approved, will be fixed in a future release.` ) ).
data(error_messages) = xmpt_controller->approve_exemptions_by_id( ids_and_assessments ).

If the user lacks the required authorizations or another error occurs, the approval/rejection step returns an error.

Configure approver responsibilities

While there is currently no UI in the SAP BTP ABAP environment systems to configure fine-grained approver responsibilities, these can be activated and configured through the API. The read and change APIs provide access to all required parts, including defining check and object groups, defining areas of responsibility, and assigning specific users to those areas.

data(appr_resp_config) = atc->get_approver_resp_api_for_chng( ).
appr_resp_config->set_enabled( abap_true ).

data(object_group_config) = appr_resp_config->get_object_group_api_for_chng( ).
object_group_config->create_groups( value #( 
  ( name="MY_OBJECTS" 
    description = 'My object group' 
    range = value #( 
      ( category = if_satc_api_appr_object_grps_r=>category-object_name
        sign = if_satc_api_appr_sel_criteria=>sign-include
        option = if_satc_api_appr_sel_criteria=>option-contains_pattern
        value="Z_MY_OBJECT_*" ) ) )
  ) ).
object_group_config->save( ).

data(check_group_config) = appr_resp_config->get_check_group_api_for_change( ).
check_group_config->create_groups( value #(
  ( name="ALL_CHECKS"
    description = 'Every check'
    range = value #( 
      ( category = if_satc_api_appr_check_grps_r=>category-check_name 
        sign = if_satc_api_appr_sel_criteria=>sign-include 
        option = if_satc_api_appr_sel_criteria=>option-contains_pattern 
        value="*" ) ) ) 
  ) ).
check_group_config->save( ).

data(area_config) = appr_resp_config->get_area_api_for_change( ).
area_config->create_areas( value #(
  ( name="MY_AREA" 
    description = 'My objects'
    object_group = 'MY_OBJECTS'
    message_group = 'ALL_CHECKS' ) 
  ) ).
area_config->save( ).
  
data(user_config) = appr_resp_config->get_resp_api_for_change( ).
user_config->create_area_assignments( value #( 
  ( area="MY_AREA" approver = sy-uname )
  ) ).
user_config->save( ).

appr_resp_config->save( ).

This code creates an object group named MY_OBJECTS, a message group named ALL_CHECKS, and an area named MY_AREA comprising those groups. It then assigns the current user to that area.

Implement custom ATC check

The released API IF_CI_ATC_CHECK provides you the opportunity to implement your own custom ATC check. See the blog post  How to create your own ATC check in ABAP Development Tools for Eclipse for details.

For some read-only use cases, there are also released CDS views that can be used to access ATC data.

You can get the overview of available released CDS views either in the ABAP development tools for Eclipse by applying the search filter api:use_in_cloud_development appl:bc-dwb-cex-ccm, bc-dwb-too-atf type:ddls:

or in the Cloudification Repository: https://sap.github.io/abap-atc-cr-cv-s4hc/?product=btp&states=released&softwareComponents=SAP_BASIS&…

Olgadolinskaja_1-1779278654035.Png

Get ATC findings

The CDS view SATC_API_FINDINGS returns ATC check run result findings with basic information about the affected object, potential exemption information, location and information about the check which produced the finding.

Get ATC results headers

The CDS view SATC_API_RESULT_HEADERS returns ATC check run results with aggregated basic information about the number of findings with certain priorities, potential number of check run failures and some scheduling information of the check run.

Read ATC exemptions

You can use the CDS view SATC_EXEMPTIONS_DDLV_EC1 to retrieve central exemptions and the CDS view SATC_EXEMPTIONS_DDLV_EC2 to retrieve local exemptions (object type CHKE).

Access ATC results of the Custom Code Migration app projects

If you want to access ATC results which have been created in the Analyze Custom Code app (Custom Code Migration app), you can use the CDS views SYCM_APS_PROJECT and SYCM_APS_ATC_FINDINGS. The findings view is also linked to the CDS view SATC_API_FINDINGS mentioned above.

 

 

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *