How to check your custom ABAP code for SAP BTP ABAP Environment
With the SAP’s offering SAP Business Technology Platform (BTP) ABAP Environment – formerly known as SAP Cloud Platform ABAP Environment – (see the announcement blog and what’s new in 2019 blog from Harald Kuck) ABAP developers are now able to make use of their existing ABAP know-how to develop and run ABAP applications in SAP BTP.
Now imagine the following situation. You are a SAP customer or partner and want to adapt the new SAP’s offering SAP BTP ABAP Environment to develop and run ABAP applications in SAP BTP, and you have ABAP code in your ERP system, which you think would perfectly fit into the Cloud. In this way you want reuse your existing on-premise ABAP assets in the Cloud. How to find out which adaptations are necessary to run your ABAP code in the SAP BTP ABAP Environment?
The answer is pretty simple, and the SAP tool is well-known: you can use ABAP Test Cockpit (ATC), which you (hopefully) broadly use in your on-premise landscape for static quality assurance or within your SAP S/4HANA conversion project.
And now come the actual news: especially for Cloud reuse of ABAP code we offer new ATC Cloud readiness checks.
You have different options to analyze your ABAP custom code with ATC Cloud readiness checks.
ABAP custom code analysis options for Cloud
Remote ATC with SAP GUI
The prerequisite for this option is the Remote ATC infrastructure with the central ATC check system on the SAP_BASIS 7.52 release.
In order to check the readiness of your custom code for the SAP BTP ABAP Environment, you need to execute new Cloud Readiness checks, provided with the new Code Inspector check variant SAP_CP_READINESS_REMOTE, which is available with dedicated SAP notes for the SAP_BASIS 7.52 release.
Using the new SAP_CP_READINESS_REMOTE check variant you can check your custom code for execution readiness in the SAP BTP ABAP Environment. The cloud readiness checks detect the following incompatibilities:
- Use of development objects, which are not supported (e.g. Dynpros, Reports…)
- Use of development objects, that are not released
- Use of language elements, which are not in the restricted ABAP language scope version 5 (ABAP language for Cloud)
1. Setup ATC in a central check system SAP_BASIS 7.52 and configure in your landscape as described in the blog Remote Code Analysis in ATC – Technical Setup step by step.
Note: only >=SAP_BASIS 7.52 system (SP01 or higher) is required.
2. Implement the following SAP Notes in your ATC central check system:
- SAP Note 2682626 – Code Inspector Check for restricted language scope version 5 (ABAP for SAP Cloud Platform)
- SAP Note 2684665 – Custom code checks for SAP Cloud Platform ABAP Environment
- SAP Note 2830799 – Custom code checks for SAP Cloud Platform ABAP Environment (2)
Note: the SAP Note 2830799 also delivers the check variant SAP_CP_READINESS_REMOTE_PREV, which you can use as a check preview for the next SAP BTP ABAP Environment release, concerning released and deprecated objects.
This is how the new SAP_CP_READINESS_REMOTE check variant looks like:
ATC checks for the following allowed object types: ‘BDEF’ , ‘CLAS’, ‘DCLS’ , ‘DDLS’ , ‘DEVC’ , ‘DOMA’ , ‘DTEL’ ‘ENQU’ , ‘FUGR’ , ‘FUNC’ , ‘INTF’ , ‘MSAG’ , ‘TABL’ , ‘TTYP’ , ‘XSLT’ .
3. Create ATC run over your custom code package using the SAP_CP_READINESS_REMOTE check variant:
4. Analyze the ATC findings:
Remote ATC with SAP Fiori App Custom Code Migration in the Cloud
The prerequisite for this option is the SAP Fiori App Custom Code Migration running in the SAP BTP ABAP Environment.
First you need to get access to the SAP BTP ABAP Environment. For more details see SAP BTP, ABAP environment in SAP Cloud Platform Discovery Center or SAP BTP, ABAP environment in the SAP Store.
Then you have to establish communication from your SAP BTP ABAP environment instance to your SAP on-premise system using RFC and SAP Cloud Connector. Finally, you must enable your SAP Fiori App Custom Code Migration in the Cloud to check your SAP on-premise system. Use SAP documentation on SAP Help Portal Enable Usage of the Custom Code Migration App.
The SAP Fiori App Custom Code Migration will run check custom code in your on-premise SAP system using the remote ATC infrastructure with RFC through SAP Cloud Connector:
Remote ATC with SAP Fiori App Custom Code Migration on-premise
The prerequisites for this option are the Remote ATC infrastructure, SAP S/4HANA 1909 as a central ATC check system and the SAP Fiori App Custom Code Migration setup and configured for the usage on the central ATC check system. Use SAP documentation on SAP Help Portal for specific implementation and configuration information on SAP Fiori App Custom Code Migration. The SAP Note 2436688 provides all required SAP Notes for the SAP Fiori App Custom Code Migration.
Using SAP Fiori App Custom Code Migration for Cloud readiness
Create your Custom Code Migration Project
Start Custom Code Migration App on your SAP Fiori Launchpad. You can maintain multiple custom code migration projects in the App (as well for SAP S/4HANA migration as for SAP BTP ABAP Environment):
Create your custom code migration project by clicking the Create button and entering your project data: Project Description, “SAP BTP ABAP Environment” as Target Release and RFC Destination to your SAP backend system on-premise and click the Save button.
Cloud readiness checks
Now the custom code analysis for the Cloud gets started and you see the status on the Analysis Progress status bar and can press the (Refresh) button from time to time to monitor the progress.
The following Cloud readiness checks will be executed by the remote ATC in the App on your custom ABAP code:
- Checks for only released objects for Cloud usage (e.g. no Dynpros)
- Checks for ABAP Language Version 5 (Cloud) (e.g. no SUBTRACT/MULTIPLY)
- Checks for usage of released APIs for Cloud
Define scope of your Custom Code Migration Project
Now you can define which ABAP custom code must to be taken over to SAP BTP ABAP Environment.
Navigate to the Scope overview. You will see the graphical presentation of the detailed scope information. Initially the scope contains no objects.
Now you can click Scope Packages to add your custom code objects. Select the package containing your custom code objects (ZFLIGHT_EVALUATION in the example below) and click Add to scope. As you can see on the screenshot below not only the objects of this package were taken over into the scope but also some objects of the package ZFLIGHT_REUSE_LIB. This is because these objects are statically referenced by the objects of the package ZFLIGHT_EVALUATION and therefore must also be included into the scope.
If you now navigate back to the Scope overview graphical presentation, you will see that it now contains the objects which you added to the scope:
You can anytime adjust the scope manually by adding/removing objects or packages.
Analyze your custom code with Cloud readiness checks
As soon as you created your Custom Code Migration Project the Cloud readiness checks are executed automatically by ATC and the App offers you the analytical presentation of Cloud readiness custom code check findings.
After the custom code analysis is finished you can click on the Number of Findings in Last Run to navigate to the detailed ATC results:
You will get the following picture:
Using the visual filters above you can group your ATC findings to get information on for example:
- What are the most important (urgent) findings (-> filter Findings by Priority)
- How many findings relate to the custom code objects you take over to the Cloud (-> filter Findings by Scope Information)
- How many findings relate to your custom package XYZ (-> filter Findings by Package)
- In which Cloud readiness areas (e.g. not using restricted ABAP language scope or released APIs) do you get the most findings (->filter Findings by Check Title)
- For which findings there are Quick Fixes available and which findings you need to fix manually (->filter Findings by Quick Fix Availability)
On the picture above the Cloud readiness findings are filtered by Scope Information and Quick Fix Availability.
You can also click on the Object Name and navigate to the source code on the target system, which will be displayed in the separate browser window.
See Documentation on SAP Fiori App Custom Code Migration on SAP Help Portal.
See also the blog Semi-automatic custom code adaptation for SAP BTP ABAP Environment.