Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
Just imagine you have implemented a new ABAP test cockpit (ATC) check in your ABAP cloud system (SAP BTP, ABAP environment or SAP S/4HANA Cloud, public edition) and bundled it into your custom ATC check variant. Since this new ATC check variant fully covers your special testing requirements, you would like to reuse this check variant also in your SAP S/4HANA on-premise system.

Now you can use abapGit to import and export ATC check variants, ATC check objects and ATC check categories across your on-premise and cloud ABAP systems. Thereby all use cases are supported: it does not matter if you transfer the ATC objects between only ABAP cloud systems (for example SAP S/4HANA Cloud, public edition and SAP BTP, ABAP environment systems) or ABAP on-premise systems (for example two SAP S/4HANA on-premise systems) or mixed scenarios (for example SAP S/4HANA Cloud, public edition and SAP S/4HANA on-premise systems).

Let’s take a look in detail how it works by using a small example of transferring a custom ATC check and a custom ATC check variant from the ABAP cloud system to the ABAP on-premise system.

Prerequisites


If your use case includes an on-premise system, it must be >= SAP S/4HANA 2021.

Implement the following SAP Note:

3279295 [ATC / abapGit] Dump while importing Import of ATC Objects.

NOTE: if you want to use this functionality in the SAP S/4HANA 2021 release, then additionally you need to implement the following SAP Notes:

3138721 - Remove Feature Toggle for ABAP File Formats
3145107 - Write posix EOF and EOL (for JSON)
3138884 - Update CHKO, CHKC and CHKV to recent ABAP file format and CHKV JSON-based UI
3150975 - Add more parameter options for ATC checks in ATC Variants

Create ATC objects in the ABAP cloud system


For our example we create the new package ZATC_CHECKS_DEMO in the ABAP development tools for Eclipse in our SAP BTP, ABAP environment system, and there we implement a new simple ATC check, which verifies, if the length of a method (the amount of the source code lines) exceeds a certain threshold. For this we implement the class ZCL_ATC_CHECK_METHOD_LENGTH (based on the API IF_CI_ATC_CHECK) and create the new ATC check ZCHECK_METHOD_LENGTH by using the New ABAP Repository Object wizard (New->ABAP Repository Object or “Ctrl + Shift + N”) and choosing the ATC Check:


For the simplification purpose we will use the already existing ATC check category “Robust Programming” (CI_ROBUSTNESS):


For the detailed information on how to create an ATC check see also the blog How to create your own ATC check in ABAP Development Tools for Eclipse.

After that we create the new ATC check variant ZOD_ATC_DEMOVARIANT using the context menu of the ABAP test cockpit node in the Project Explorer:


The ZOD_ATC_DEMOVARIANT will consist only of our new ATC check “Method length check”, and additionally we will set in the Parameters section of the check the method threshold value to 10:


For the detailed information on how to create an ATC check variant see also the blog How to create and use your own ATC check variant in ABAP Development Tools for Eclipse.

Now we have the following ATC objects in our package ZATC_CHECKS_DEMO: ATC check class, ATC check and ATC check variant:



Export ATC objects to a Git repository


The next step would be to transfer the ATC objects from the SAP BTP, ABAP environment system to an external Git repository using abapGit. For this we just create the new Git repository CloudATCChecksDemo on the https://github.com/:


Now we will link this Git repository to the package of our ATC objects using the abapGit plugin in the ABAP development tools for Eclipse. For this we open the abapGit related views in the ABAP development tools for Eclipse (Window -> Show View😞


In the abapGit Repositories view we click the green “+” (Link New abapGit Repository…) button on the right side of the title bar, enter the URL of the Git repository and click the Next button:


On the next screen we enter our package name ZATC_CHECKS_DEMO and click the Next button:


After choosing the transport request and clicking the Finish button our Git repository is linked, and we will use the context menu Stage and Push:


This will lead us to the abapGit Staging view. Our ATC objects are currently in the Unstaged Changes area, because they are not tracked by the Git yet. Since only the objects which are in the Git staging area can be committed to the Git repository, we just select all our ATC objects in the Unstaged Changes area and apply the context menu Stage Objects to add them to the Git staging area:


Finally, we enter the Commit Message and click the Commit and Push button to transfer all our ATC objects from staging into our Git repository:


After this action if we just examine the content of our Git repository, we will find all our ATC objects there:


We can also take a look at our ATC check ABAP class or the ATC check variant (in JSON format):



Import ATC objects into the ABAP on-premise system


Now we just use the abapGit in the SAPGUI to import our ATC objects into the SAP S/4HANA on-premise system. If you still haven’t had a chance to know and use abapGit in on-premise ABAP systems, see the blog of graham.robinson the abapGit – so easy.

After our ATC objects were pulled successfully into the on-premise ABAP system, we can examine the content of the ZATC_CHECKS_DEMO package in the ABAP development tools for Eclipse in the Project Explorer:


Now we can activate all these ATC objects and use them. For example, we can execute an ATC run with the ZOD_ATC_DEMOVARIANT check variant over the source code in order to detect the methods, where the number of the code lines exceeds the threshold (10 in our example):


Just try it out!

 
1 Comment