Skip to Content
Technical Articles
Author's profile photo Olga Dolinskaja

How to check your custom code for ABAP Cloud

As you for sure already know, ABAP Cloud was announced at SAP TechEd 2022 and was part of the Juergen Mueller’s day 1 and Philipp Herzig’s day 2  keynotes. ABAP Cloud is the ABAP development model to build cloud-ready business apps, services, and extensions on the SAP products SAP BTP ABAP Environment, SAP S/4HANA Cloud, public edition, and SAP S/4HANA 2022 Cloud, private edition and on-premise.

You can find more details about ABAP Cloud in the ABAP Development SAP Community under the „ABAP Cloud – Developer Resources“ section, and in the ABAP Cloud blog by the Chief Product Owner of the ABAP Platform Boris Gebhardt.

As we have thought about, how to support SAP customers and partners on releases < 2022, who want to strive for the clean core with ABAP Cloud in their landscapes and use released APIs as much as possible we came up with the following considerations.

Currently you can use the Custom Code Migration app  to check your custom code for cloud readiness with the purpose of migration to the SAP BTP ABAP Environment. See also the blog How to check your custom ABAP code for SAP BTP ABAP Environment. In this case the cloud readiness checks will be executed over your custom code in the on-premise system to detect, if your custom code is compliant to the ABAP language version „ABAP for Cloud Development“ , if it uses only allowed object types in the cloud, or if it uses only released APIs of the SAP BTP ABAP Environment system.

These checks are essential for the custom code migration to the SAP BTP ABAP Environment but insufficient if you want to check your custom code for ABAP cloud development model in an SAP S/4HANA system. In this case you would need additionally check your code for the released application APIs of the SAP S/4HANA solution in the target systems, and ideally already get the recommendation which successor released APIs from the SAP S/4HANA application stack to use.

Based on these considerations we have got an idea to provide the information about the released successor APIs for ABAP cloud development on the GitHub in the so-called Cloudification Repository. This information can be then used as the input for the ABAP Test Cockpit cloud readiness checks for released APIs (analogous to the Simplification Database for SAP S/4HANA readiness checks).

The Cloudification Repository can be used with the latest version of the Custom Code Migration app in the SAP BTP ABAP Environment (2302 release).

NOTE: The Cloudification Repository is the substitute for using the SAP Note 3088062 – Identifying local APIs for S/4HANA Cloud, where you need to look up for the successor released APIs manually in the Excel table.

Let’s take a look in detail at how it works.

Choose a custom code package for analysis

We take as an example the ABAP custom code package ZS4HANA_CLOUD_MIGRATION_DEMO in the SAP ERP system. This package should be migrated to the SAP S/4HANA Cloud, public edition, and therefore it must be adapted compliant to the ABAP cloud development model.

This package contains among other things the ABAP source code objects, like for example the classes ZCL_MARA_USAGE and ZCL_KONV_USAGE which are not compliant to the ABAP cloud development model, because they access directly with the openSQL the SAP application tables MARA and KONV instead of using the corresponding released APIs:

Other ABAP source code objects in this package are also not compliant to the ABAP cloud development model. Hence we need to analyze the package to understand, which issues we need to solve on the way to the custom code migration to ABAP Cloud.

Cloudification Repository

We will use the latest Custom Code Migration app on the SAP BTP ABAP Environment (2302 release) for custom code analysis, and since the app is not able to show the successor released API in the analysis result, because it has no knowledge about which released APIs must be used in the target SAP S/4HANA Public Cloud system, we need to use the Cloudification Repository.

The Cloudification Repository is available on the GitHub, under the link https://github.com/SAP/abap-atc-cr-cv-s4hc you can get an overview about it:

Just take a look at the content of the objectReleaseInfoLatest.json file under the „src“:

It contains the released APIs in JSON format. In this JSON file you can search for example for the successor of the direct access to the table KONV. You will find the table KONV there, information about the software component („SAPCORE“) and the application component („SD-BF-PR“). The successor information points to the DDL as CDS View („I_SLSPRCGCONDITIONRECORD“), which  must be used instead of direct access to the table KONV:

You can proceed the same way and look for example for the successor of the direct access to the table BSEG, and you will find the CDS View I_OPERATIONALACCTGDOCITEM and so on.

Create your own ATC check variant using the Cloudification Repository

If we now display the ABAP_CLOUD_READINESS check variant in the SAP BTP ABAP Environment system, where our Custom Code Migration app will run, we will see, that under the Cloud Readiness checks category it contains the new check „Usage of Released APIs (Cloudification Repository)“ :

This check takes as a parameter the link to the Cloudification Repository JSON file.

We will just copy the ABAP_CLOUD_READINESS check variant (context menu „Duplicate“ in the Project Explorer or see the blog How to create and use your own ATC check variant in SAP BTP ABAP Environment for further details) and create the new ZMY_ ABAP_CLOUD_READINESS check variant. There we will unselect the check „Usage of Released APIs“ and select the new check „Usage of Released APIs (Cloudification Repository)“, and then in the details of the check we will provide the link to the Cloudification Repository JSON file:

Finally we will save and activate our new ATC check variant ZMY_ ABAP_CLOUD_READINESS. It is now ready to use.

Analyze your custom code for ABAP Cloud

Now it’s time to analyze the custom code example package ZS4HANA_CLOUD_MIGRATION_DEMO in our ERP system for ABAP Cloud using the Cloudification Repository. For that we start the Custom Code Migration app in the SAP BTP ABAP Environment system, where we have just created the new ZMY_ ABAP_CLOUD_READINESS check variant and create the new Custom Code Analysis Project:

This project will connect to our ERP system and check with the new ZMY_ ABAP_CLOUD_READINESS check variant the custom code example package ZS4HANA_CLOUD_MIGRATION_DEMO ( we provide it under the „Advanced Configuration“):

After we click the Create button the analysis will start. As soon as analysis is finished you will see, that we have the 23 findings in our custom code and can click on this number to see the analysis results.

In the analysis results we apply the filter to display only findings which are related to usage of not released APIs in our custom code package example in order to focus only on the findings for which the successor information is provided in the Cloudification Repository:

In the table with findings we can now for example select the line with the unallowed usage of the table KONV and click on the „>“ to get the details of this finding:

Here we will see the information from the Cloudification Repository JSON file about the successor CDS view, which must be used for the ABAP cloud development instead of direct access to the table KONV.

By the way you can also use the Cloudification Repository with the Custom Code Migration app on-premise or SAP GUI ATC (in the SAP S/4HANA >=2020 system) after implementing the SAP Note 3284711 – ATC Check for Released Objects (Cloudification Repository).

Using the Custom Code Migration app and Cloudification Repository you can now analyze your custom code in the on-premise systems for the ABAP Cloud and estimate the effort for the future adaptations.

Just try it out!

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jae-Uk Lee
      Jae-Uk Lee

      Great blog.

      I have a few questions about this content.

      in the jason file(PCE2022), I found only 210 list of successor of direct access to the table.
      Is that all the Successors in the Jason file?

      How do I find successor that doesn't exist in the jason file ?

      Thanks.

      Author's profile photo Olga Dolinskaja
      Olga Dolinskaja
      Blog Post Author

      Hi Jae-Uk,

      JSON file is the leading document for identification of successors. It will be updated and completed on regular base.

      Kind Regards,

      Olga.

      Author's profile photo Alexander Demidovich
      Alexander Demidovich

      Hello

      Is it based on same checks, used by the compiler, if the AP for Cloud Development language version is used (on-prem)?

       

      Thanks

      Author's profile photo Olga Dolinskaja
      Olga Dolinskaja
      Blog Post Author

      Hi Alexander,

      this check is based on ABAP Test Cockpit static check for released APIs (using Cloudification Repository), it checks only for usage of released APIs. Switching of ABAP language version to ABAP for Cloud Development will initiate compiler checks, which will check usage of released APIs but also usage of ABAP language and unsupported object types (like Dynpos for example).

      Kind Regards,

      Olga.

      Author's profile photo Saptarshi Sen
      Saptarshi Sen

      Hi Olga,

      Thanks for such detailed and informative blog.

      Had a query with regards to the whitelisted/released substitution objects data here. Looking at the data in the GitHub Cloudification repository files, we observed some variation in the counts of objects that have 1 or N successor objects available, when compared to the earlier file contents from Note#3088062. For example, the Released substitute objects data for S/4HANA 2022 contained more successor objects than what we see from the corresponding PCE_2022 csv file (objectReleaseInfo_PCE2022.csv) in the Cloudification repository.

      On the other hand in S/4HANA 2022 On-prem system, we see similar information persisted in DDIC system table - ARS_W_API_SCCSSR (CDS View - ARS_API_SUCCSSR) that seems to contain more successor object records as well. If we were to consider a single source of truth for the 'Released substitution/successor' Objects for a given product version (say S/4HANA 2022), would it be recommended to rely on the above system table contents, or we must consider the data in the new Cloudification repository files? Any guidance/ recommendation on this would be highly appreciated.

      Many Thanks & Best Regards
      Saptarshi Sen.

      Author's profile photo Felix Wente
      Felix Wente

      Hello Saptarshi,

      single source of truth are the ARS_W* tables. Their content is officially shown in the object information of ADT, or like your did. We migrate the content of further repositories (like the note) towards that one step-by-step. Thus you might observe that numbers do not always fit.

      Main reason for differences: we decided not to support objects like user exits or old BAdIs (not kernel based) in the ARS_W* tables and do not apply the successor concept for them. As we gave successor information for some of them in the note, differences occur.

      Kind regards,

      Felix

      Author's profile photo Saptarshi Sen
      Saptarshi Sen

      Thankyou for the clarification, Felix.