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 Business Technology Patform, 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.
The cloud readiness checks detect the following incompatibilities in your custom code:
- 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)
There are different options to analyze your ABAP custom code with ATC cloud readiness checks.
ABAP custom code analysis with Custom Code Migration app in SAP BTP
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 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:
Using Custom Code Migration for cloud readiness check
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.
When defining the scope, you can also display the complexity of your custom code in a graphic (click Scope Packages and then go to the Packages tab):
It summarizes the number of relevant changes in accordance with the complexity of the custom code on package level (or request entry point level of ABAP Call Monitor (SCMON), if you go to the Entry Points tab).The upper right part of the diagram represents the most complex and most frequently changed development packages. They could be potential candidates for the migration to SAP BTP ABAP Environment, since you can significantly reduce TCO of your custom code by outsourcing them to the cloud.
Furthermore, using the Settings button to choose the metrics for the chart axes, you can set up your own dashboards to perform dependency analysis of your custom code with SAP standard. You can determine for example how often your custom code calls SAP application APIs:
or uses DB accesses to SAP application tables (like for example direct call on the MARA table):
Your custom development packages, which are loosely coupled with SAP standard (which are placed in the lower area along the X axis) are good candidates for the migration to the SAP BTP ABAP Environment.
After setting up a dashboard you can save it as your own view:
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.
ABAP custom code analysis with Custom Code Migration app on-premise
If you don’t have access to the SAP BTP ABAP Environment you can also use 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.
ABAP custom code analysis with Remote ATC in SAP GUI
If you don’t have access to the SAP Fiori App Custom Code Migration you can also use the SAP GUI transaction ATC for cloud readiness check.
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 SAP GUI transaction ATC for cloud readiness check
Using the SAP GUI transaction ATC and the SAP_CP_READINESS_REMOTE check variant you can check your custom code for execution readiness in the SAP BTP ABAP Environment.
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:
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.
As mentioned in note 2684665 , Object types from the ABAP in-house developments like ‘Screens, Report, WebDynpros’ are not available on the SCP.
Then my question is-- If customer wanted to replicate their screens, webdynpros or reports from on-premise ABAP to SCP ABAP Environment then how that can be achieved?
the object types, which are not supported in ABAP SCP can not be used there. Only custom code which can be run in ABAP in SCP should be transformed. Especially for UI you should think about replacing UI with SAP Fiori.
Now there are 2 Cloud versions: S/4 HANA Cloud MTE & STE.
My questions are -
1. For Remote ATC, is “SAP_CP_READINESS_REMOTE” check variant only for S/4 HANA Cloud MTE, not for S/4 HANA Cloud STE? And which check variant is for STE?
For Fiori CCM APP, is “SAP Cloud Platform ABAP Environment” Target Release only for S/4 HANA Cloud MTE, not for S/4 HANA Cloud STE? And which Target Release is for STE?
Thanks and Regards,
there is no custom code migration path to SAP S/4HANA Cloud (neither to STE no to MTE). Custom code development starts from scratch (greenfield), and you can develop side-by-side extensions using e.g. SAP Cloud Platform ABAP Environment. You can also take custom code over from on-premise systems to SAP Cloud Platform ABAP Environment and check it for cloud readiness using SAP_CP_READINESS_REMOTE check variant in the Custom Code Migration app.
I hope it is more clear now.
Thanks a lot!!!
Hi Olga Dolinskaja ,
Thank you for sharing the blog, it is very helpful.
We have an custom add-on which is running on S4H on-premise infrastructure, however, is there any tool/method that we can leverage to check the compatibility of the add-on on S4H cloud before installation.
cloud readiness checks (as described in the blog) are necessary. Do you want to run this add-on in side-by-side mode in SAP BTP ABAP Environment?
Thanks for the quick response, No we want to install the custom add on in the S4H cloud, and before that, we want to run some checks to make sure the add on will go smoothly.
if you mean SAP S/4HANA Cloud, extended edition, then your add-on should actually run there if it works on SAP S/4HANA on-premise. If you mean SAP S/4HANA Cloud, essentials edition, you would need to check it with ATC for Cloud readiness and adapt to ABAP language version cloud.
maybe you want to raise this question in the https://community.sap.com/topics/s4hana-cloud-extended-edition community?
Thanks a lot!!!
Hi Olga, is there a restriction of what kind of development package can be checked?
I am getting an error when we use one of the package.
Restricted package error
you need to register your name space (/E) in the system which shall be analyzed by ATC as described in the following documentation:
Thank you Olga for a very quick response, appreciate it! Will check and update if it worked!
Is there a way to do the enhancements to the standard code in the BTP ABAP environment? Can it help in keeping the S4 core clean? Also, I see ENHO is not part of the object Types that can be checked via ATC variants, so is the reason because the standard code cannot be segregated to keep standard and custom enhancements/BADI implementations separate?
to keep the core clean development in SAP BTP ABAP Environment must be carried out in side-by-side mode. Consequently enhancements and modifications are not supported in SAP BTP ABAP Environment, BAdIs are supported. See also the blog https://blogs.sap.com/2020/08/05/how-to-extend-sap-standard-using-adt/.
hi Olga Dolinskaja ,
We are currently creating a Cloud Application Programming application that is currently deployed in BAS hosted on BTP. The application currently uses S/4 HANA Odata CDS services. I wanted to check that if these CDS are also cloud compatible or not.I ran the above check variant and the majority of errors are related to 'Access of Certain Data elements' which is coming as errors in the variant check report.
Any idea how can this be overcome. Or it simply means that those On Premise artifacts cannot be moved to BTP at all, at this point of time?
Attaching a screenshot for your reference.
yes, direct access to not released objects/APIs for usage in SAP BTP ABAP environment is not allowed because they are not available there.
Hi Olga Dolinskaja ,
Thanks for the prompt response Olga! Appreciate it.
When you say 'direct access is not allowed', is there something called 'indirect access' and by which it could get migrated to SAP BTP ?
if you mean access to the tables, then they must be accessed remotely (BAPI, oData, SOAP...) or even replicated using SLT (if the data is more frequently required). Regarding accesses to the application logic of SAP S/4HANA on-premise, only released APIs can be used (SAP API Hub).