The Importance of Custom Code Analysis and Adaptation in S/4HANA Conversion Projects.
There are many special features that differentiate SAP HANA from other databases. This has an impact on the way we write ABAP programs. For example: Column Store, Compression, Parallel Processing etc… This has an impact on SAP S/4HANA custom code when we move from SAP ERP to SAP S/4HANA. Database specifics like native SQL & DB Hints may have to be removed or needs to be adjusted.
Indirect impacts have to be checked, such as direct access to table pools and table clusters that no longer exist. Or coding that relies on the existence of a given secondary index. As a part of the simplification process, SAP may have removed, replaced or changed repository objects. We call these simplified repository objects. Custom code that is independent of the simplified objects will run on S/4HANA without any adoption. Custom code that accesses these repository objects might have to be adapted in order to work properly or to work optimally. The amount of adaption work depends on the nature of the simplification and how the custom code uses the simplified object.
All the simplification items are documented in dedicated SAP notes. Technical and Functional consultants working on SAP S/4HANA Conversion projects verify for any SAP Recommendations on code adaptation.
Discontinued Functionality & Deleted Objects
Some of the repository objects from SAP ERP might have been removed in SAP S/4HANA. Any access to such repository objects in the custom code leads to syntax errors during activation and may lead to dump after conversion if we don’t make changes.
Programmers needs to verify programs and Z Transaction codes that contain such discontinued objects. Custom code that accesses such programs will terminate if custom code is not adapted and adjusted.
Blacklist Repository Objects
With a blacklist Monitor tool, execution of a selected executable repository object may be prohibited dynamically without modifying ABAP coding. When control reaches a blacklisted artefact, program execution terminates like below.
• For General Information, Refer 2476734
• For detailed information, refer 2249880
Adjusted files length extensions
In SAP S/4HANA, some fields’ length changed over ECC. For example: Material Number changed from 18 to 40 CHAR. It is important to ensure that the fields are not truncated to their previous length. So we can ensure data. The corresponding SAP development entities needs to be adapted accordingly.
As long as custom code consequently uses SAP data types, we do not get any issues. But wherever the former length is hard coded in the program, then it causes an issue.
Data Model Redesign
An important part of simplification in SAP S/4HANA is related to data model change. In SAP ECC, we can see aggregate, history and Index tables. In SAP S/4HANA, these tables are no longer available.
The custom code that access redundant tables have to be adjusted.
In some of the areas, the redesign went deeper.
SD documents in ECC, VBUK (Header) & VBUP (Line item). In AS/4HANA the status values are stored in the document tables themselves. As a result, the status information has been moved to tables VBAK and VBAP for sales orders. As a consequence, the custom code that is used to read from tables VBUK and VBUP needs to be adjusted to read status information from the respective document tables.
Table Exists – No proxy object
Probably the most difficult category is redundant tables that still exist in the system, but do not have a proxy object.
Database tables VBUK & VBUP belong to this category, but also other database tables such as KONV for conditions.
Simplification database content is published by SAP and available for download in the software download section of SAP support portal. Refer to SAP note 2241080. Simplification database content is uploaded into an SAP system using Transaction code SYCM.
Custom Code Analysis and Adaptation in SAP S/4HANA Conversion Projects
When SAP ECC Customers choose the system conversion approach to move to SAP S/4HANA, one of their motivation factors is a “desire to keep their existing Custom Code”. (Rather, protecting their investment on Custom code). The main task during the preparation phase is Analysis of Custom code that is affected by Simplifications. If the source system is not HANA database, the additional adjustments are needed. It would be ideal to identify unused custom code during the analysis phase. So that helps to reduce effort on custom code.
Some code adaptations don’t depend on SAP S/4HANA specific repository. For example, adding ORDER BY to SELECT statements or replacing a hard-coded filed length with a suitable data element or domain. Experienced consultants perform these adaptations during the preparation phase of the conversion project.
Other code adjustments rely on SAP S/4HANA Database tables. Modification has to be adjusted in the usual way via SPDD and SPAU.
Which tools help in custom code analysis?
There are different tools that help with:
1. Identifying unused custom code
2. Static code checks
3. Code Analysis (ATC)
ABAP Call Monitor (SCMON)
SCMON Comes with enhanced functionality compared to UPL – you can consider SCMON as a successor and can be used instead of UPL.
The Transaction SUSG allows us to aggregate and manage the usage data collected by ABAP call Monitor for a period of time.
Custom Code Adaption
After the system conversion, we perform functional adaptations in custom code. We need to adapt any modifications related to ABAP dictionary objects using Transaction SPDD. After system conversion (SUM), we adapt modifications related to repository objects using transaction SAPU and SPAU_ENH. Then, we execute ABAP test cockpit (ATC) with SAP S/4HANA checks in ABAP Development tools (ADT). We have to refer to SAP notes which describe how to solve the issues. Based on the ATC findings, we start adapting custom code using quick fixes in a semi-automated way.
Automated Custom Code Adaption
With SAP S/4HANA, ABAP development tools in Eclipse enable the automate adaption of custom code with a few clicks through quick fixes. These can resolve the most frequent findings, such as ORDER_BY issues related to data model changes such as KONV. BSEG, and others. Once the development system is converted to SAP S/4HANA, execute SAP S/4HANA-relevant ATC checks in Eclipse. 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.
Optimisation of Custom Code
The ABAP test cockpit can be used for checking poor performance custom code developed in ABAP. However, optimising the entire body of custom code with this tool may not be possible. It is therefore better to use the SQL performance tuning worklist and SQL monitor tool.
Remote Checks with ABAP Test Cockpit (ATC)
Starting with release 7.51, ATC allows you to analyse code in remote systems. It is recommended to set up a central check system from which you run checks in all other systems of your landscape.
The checked system can be any ABAP-based system with release 7.00 or higher.
Prerequisites in the checked system:
• Implementation of remote stubs and remote extractors. For more information, see SAP Notes 2485231, 2270689, 2190065, and 2196792.
• Remote Function Call (RFC) user with suitable authorisation to read all repository objects and to execute the remote stubs. For more information, see SAP Note 2672703.
The prerequisites in the central check system:
• Release 7.51 or higher (highest available recommended).
• RFC connection to the checked system (no logon dialog, user as above).
• Implementation of the corrections recommended in SAP Note 2364916.
• Dialog user with sufficient authorisation to use ATC or remote checks. For more information, see SAP Note 2672703.
Configuration of the Central Check System
1. In transaction ATC, double-click System Role and choose Display → Change, select ATC Checks by Object Providers Only, and choose Save.
2. Return to the Initial screen of ATC and double-click object providers.
3. Double-click System Groups and create a new entry.
4. Double-click RFC Object Providers and create a new entry (Specify the system group defined in the figure, Configuring the Central Check System, and the RFC destination to the source of the remote check).
5. Double-click Correction Systems and create a new entry (specify the system group created in the figure, Configuring the Central Check System, and RFC destination to the correction system).
Custom Code Migration App
This app is useful for analysing custom code in an SAP ECC system. We can identify custom code, during the Readiness check for Compatibility with SAP S/4 HANA. It also identifies unused custom code during the system conversion, This FIORI App can also be used to analyse custom code to check whether it is ready for the SAP Business Technology Platform ABAP Environment.
The Custom Code Migration App extracts the following metadata:
• Usage of SAP objects in your custom code
• Extensions, such as enhancements or database table appends, made to SAP Objects
• Modifications made to SAP objects.
The custom code migration app is an SAP Fiori app that must be configured and added to your existing SAP ERP system, alternatively, the classic SAP GUI can be used to run the SAP S/4 HANA checks based on the ABAP test Cockpit (ATC). Additional information is available in these resources.
The prerequisites for using the custom code migration App
• The S/4HANA system has release 1809 or newer
• Simplification database is available (Transaction SYCM)
• The S/4HANA system is configured as central check system
• ATC Objects providers are available for the checked systems
• OData Services
– User Role SAP_BC_YCM_APS is assigned to the user
About the Author:
Dr. Ravi Surya Subrahmanyam is a technical and Financials writer with a background in SAP Financial Accounting, Funds Management, Group Reporting, Financial Supply Chain Management, Cash Management & in-house cash, SAP S/4 HANA Finance. He has been working as a Senior Director for the SAP Practice for The Hackett group India Ltd, (Answerthink Company). He completed Master’s degree in Finance from Central University, Master of Commerce from Osmania University, Master of Commerce from Andhra University, and Ph.D.in Finance from one of the best universities in India. His research Papers have been published in National and International magazines. He has been a Visiting Instructor for SAP India Education and SAP Indonesia – Education. He has been working on Conversion and Upgradation projects. He is a Certified Solution Architect for SAP S/4 HANA and an SAP S/4 HANA Certified Professional. He can be reached at email@example.com or firstname.lastname@example.org