Custom Code Migration and Adaptation
Custom Code Migration is part of the system conversion process from the classic SAP Business Suite running on any database to the SAP S/4HANA system. In the context of this system conversion, custom ABAP source code needs to be adapted, since a lot of SAP code within SAP S/4HANA was simplified and in some cases changed in a non-compatible way. Some of your custom code objects will no longer be valid anymore or simply no longer perform as expected or produce syntax errors. SAP provides tools based on the Simplification Database, that detect any custom code that needs to be adapted to SAP S/4HANA. The Simplification Database is a database table in the SAP S/4HANA system that contains all simplification items that refer to SAP objects simplified in SAP S/4HANA. Each simplification item describes changed or removed SAP objects and refers to a dedicated SAP Note that describes the impact of the change and how the related custom code can be adapted.

Custom Code Scoping
Custom code scoping enables you to determine the ABAP custom code that is frequently used and needs to be taken over to SAP S/4HANA. Unused custom code can be deleted using deletion transport requests during the system conversion. This scoping step is important, because you will ultimately be able to reduce the number of custom code entities to be migrated and minimize the custom code adaptation efforts.
Custom Code Migration SAP Fiori App
The Custom Code Migration SAP Fiori app is used for custom code scoping. The app can be implemented in your existing ERP system or run in the Business Technology Platform to perform custom code checks on your system data. It evaluates development objects to be adopted to SAP S/4HANA for compatibility and identifies unused custom code. You can then remove this unused custom code during the system conversion.
You can use the Custom Code Migration app to:
- Run the SAP S/4HANA checks to analyze which custom code needs to be adapted.
- Get statistical information about the findings in your development objects that need to be adapted.
- Download the analysis results (for future upload in SAP Readiness Check)
Note
Learn how to configure the Custom Code Migration app here.
Custom Code Adaptation (functional)
After the system conversion, you need to perform the functional adaptations in your custom code. In the system conversion, you need to adapt any modifications related to ABAP Dictionary objects using transaction SPDD. After you performed the system conversion to SAP S/4HANA with Software Update Manager (SUM), you need to adapt any modifications related to repository objects using transactions SPAU and SPAU_ENH. After this, we recommend that you run ABAP Test Cockpit (ATC) with SAP S/4HANA checks in ABAP Development Tools (ADT). The result is a list of ATC findings that relate to SAP S/4HANA simplifications and refer to SAP Notes which describe how to solve the issues. Based on these ATC findings, you can start adapting your custom code using quick fixes in a semi-automated way.
Automated Custom Code Adaptation
With SAP S/4HANA, ABAP development tools in Eclipse enable the automated adaptation of custom code with a few clicks through quick fixes. These can resolve the most frequent findings, such as ORDER_BY issues and issues related to data model changes such as KONV, BSEG, and others. Once your development system is converted to SAP S/4HANA, execute SAP S/4HANA-relevant ATC checks in Eclipse. Do not apply all quick fixes at once; this might overload the system and generate a log that's hard to comprehend. The ATC can scan objects with correct ABAP syntax only. Therefore, use quick fixes to resolve the syntax errors first, and repeat the ATC check. The second iteration will most likely uncover new findings.
Modernizing Custom Code to follow the Clean Core
After the mandatory changes or enhancements are made, customers should consider modernizing their existing custom code to follow the ABAP Cloud development model. In the long-run, this makes the customer's system easier to upgrade so they can experience the new features and functionalities that become available through each release. Modernizing custom code means taking classical ABAP developments (Tier 3), and using the ATC to identify if there is cloud-ready code through the ABAP Cloud environment available to replace it (Tier 1), or a custom wrapper that can be used if there are currently no released APIs available (Tier 2).
Learn how to use the ATC to modernize custom code in this SAP Blog: How the ABAP Test Cockpit supports you to adopt ABAP Cloud.
Optimization of Custom Code
The ABAP test cockpit offers performance checks to reveal poorly performing custom code developed in ABAP. However, optimizing the entire body of custom code with this tool is likely not achievable. Instead, use the SQL performance tuning worklist and SQL monitor tool. The SQL performance tuning worklist combines the results of static code checks performed by the ABAP test cockpit with runtime and performance data supplied by the SQL monitor tool. Together, they detect critical performance hot spots and prioritize opportunities for optimization.