Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert

Last edit: October 30, 2023


Why do you need to adapt your custom code during system conversion from the classic SAP ERP system running on any DB to SAP S/4HANA? The blog SAP S/4HANA System Conversion – Challenge for your custom code gives you the answer to this question.

📹Watch the video about custom code migration to SAP S/4HANA  on the SAP Technology YouTube channel:

 

 

Considering SAP S/4HANA system conversion (more on this in SAP S/4HANA System Conversion – At a glance) we focus in this blog on the custom code related process, which consists basically of two major phases. Before SAP S/4HANA system conversion – during preparation phase – we recommend to get rid of your old unused custom code (custom code evaluation) and then analyze your custom ABAP code with the Simplification Database and find out which objects need to be changed to get adapted to the SAP HANA and SAP  S/4HANA (SAP S/4HANA checks). After SAP S/4HANA system conversion – during the realization phase – you need to adapt your custom ABAP code to the new SAP S4/HANA software (functional adaptation) and optimize performance for SAP HANA database (performance tuning).


IMPORTANT NOTE: This custom code adaptation process including all following recommendations, processes and the tools  is not a "one-time procedure" and has to be carried out on a permanent basis especially before the SAP S/4HANA system conversion and before upgrade within the SAP S/4HANA product family and is to be considered as the regular best practice also for SAP Business Suite, SAP S/4HANA and generally all other ABAP-based products.

Custom code scoping

A typical ERP customer system contains a large amount of custom development objects (Z-Objects, enhancements and modifications) that are not used productively. Therefore, it is recommended to monitor your system landscape for a longer period of time in order to do some housekeeping and eliminate the code, which is not used anymore within your productive business applications. This procedure is very important and will significantly minimize your custom code adaptation efforts.

For this purpose, we recommend to turn on the ABAP Call Monitor (SCMON) or Usage Procedure Log (UPL) in your production system to find out, which custom ABAP objects are really used within your running business processes. You can also use this step for prioritization: to find out which objects are more important as the others. The SCMON or UPL has no impact on the performance of your production system.

The advantage of the SCMON compared to the UPL is that using this tool you not only collect the usage data (how often a specific ABAP object was called), but also the information about the calling business process. See ABAP Call Monitor (SCMON) - Analyze usage of your code for more details.

The recommended procedure for usage data collection is ABAP Call Monitor with aggregation of the collected usage data using the SUSG transaction. See Aggregate usage data in your production system with SUSG transaction for more details.

Usage data collected in the SAP Solution Manager 7.2/CCLM can be also used for custom code scoping. Generally, the Solution Manager 7.2 collects either SCMON or UPL data depending whether the connected system is capable of SCMON or UPL.

NOTE: You should collect usage data for a longer period of time (at least one year) to get really reliable results for not productively used code.

SAP HANA and SAP S/4HANA checks

This step is the most important one for your custom ABAP code on the way to the system conversion to SAP S/4HANA.  Here you check your custom ABAP code for SAP HANA and SAP S/4HANA related changes.

The SAP S/4HANA is based on the SAP HANA database. Generally, the ABAP code runs on SAP HANA as on any other supported database. So why do you need to adapt it to SAP HANA? One reason is, that you possibly used native SQL of the predecessor database and these database vendor specific dependencies must be eliminated. Another reason is, that in some custom code implementations the SELECT statement without ORDER BY is used. This can lead to unexpected behavior when the database is changed (for example to SAP HANA) because the results return in a different order without ORDER BY. Therefore, you need to check your SQL SELECTs without ORDER BY statement if they are still correct. Beyond this pool/cluster tables were removed with SAP HANA, therefore the database operations on these tables also need to be removed from your custom ABAP code.

To prepare your custom ABAP code for the actual SAP S/4HANA conversion, you need to compare it with the Simplification Database. For more information on Simplification Database please refer to the blogs Upcoming tools for SAP S/4HANA migration - the simplification database, Simplification List SAP S/4HANA 2023.


SAP S/4HANA Checks in SAP NetWeaver AS ABAP 7.51/7.52

The Field Extension check finds length conflicts in your coding for material number fields        (can be suppressed with pseudo comment CI_FLDEXT_OK[note_number])

The Search DB Operations check finds write operations on specific database tables (can be suppressed with pseudo comment CI_DB_OPERATION_OK[note_number])

The Search for usages of simplified objects check finds usages of objects stored in Simplification Database (can be suppressed with pseudo comment CI_USAGE_OK[note_number])

The Search for ABAP Dictionary enhancements finds extensions in the data dictionary (like appends)

The Search for base table of ABAP Dictionary views finds usages of database tables in views

The Search for S/4HANA related Syntax errors tries to map syntax errors to simplification items
NOTE: Starting with SAP NetWeaver AS ABAP 7.52 there are special pseudo comments to suppress false-positive findings for simplification items incl. SAP Note number:In SAP NetWeaver AS ABAP 7.52 the coverage of checked custom code was significantly improved. Custom code checks now scan all custom code in Enhancements, Modifications, Customer EXITs, Smart Forms, Adobe Forms and ignore findings in SAP includes and generated code. Additionally simplification item information (e.g. OSS note)  is displayed in ATC result list including filtering and sorting capabilities. It is also now possible to scan custom SAP queries, see the blog How to check your SAP Queries for SAP S/4HANA readiness.

Technical infrastructure for custom code analysis

The tool of choice for SAP S/4HANA and SAP HANA checks is the ABAP Test Cockpit (ATC) with remote code analysis. You set up only one central ATC check system for all static checks of your custom ABAP code in your system landscape, which needs to be migrated to SAP S/4HANA. More details in the blog series Remote Code Analysis in ATC.

The recommended procedure is the following:

Setup ATC as (see Remote Code Analysis in ATC – Technical Setup step by step) and implement the SAP Note 2436688 - Recommended SAP Notes for using ATC checks "S/4HANA Readiness"
Download the newest version of the Simplification Database content from SAP Service Marketplace (see SAP Note 2241080)
Install the Simplification Database content on the central ATC check system (use transaction SYCM).

NOTE: if you intend to execute SAP S/4HANA readiness checks locally, then the SAP Note 2436688 - Recommended SAP Notes for using ATC checks "S/4HANA Readiness" must be implemented on your local system.

Custom code analysis options

The ABAP Test Cockpit comes along with its classic SAP GUI based user interfaces to administer the tool and maintain the necessary configuration steps in order to check the custom code.

With ABAP platform 1809 we simplified the whole custom code adaptation process by providing a new SAP Fiori App Custom Code Migration that allows you to execute SAP S/4HANA checks just with a few clicks.

SAP Fiori App Custom Code Migration can also be configured and run in the SAP BTP ABAP Environment - formerly known as SAP Cloud Platform ABAP Environment.

The following picture presents all custom code analysis options at one glance:


Remote ATC with SAP GUI

The prerequisites for this option are the remote ATC infrastructure and ATC central check system (SAP_BASIS 7.52). Run ATC transaction with the check variant S4HANA_READINESS_REMOTE containing SAP S/4HANA and SAP HANA checks and analyze the ATC result list. ATC offers you best support for detailed analysis of SAP S/4HANA findings using Statistics View, simplification information in ATC result and various navigation capabilities. See also the blog Remote Code Analysis in ATC – Working efficiently with ATC Result List.

For live demonstration of end-to-end custom code adaptation process in SAP GUI check also the Video on YouTube:

Remote ATC with SAP Fiori App Custom Code Migration

You can configure and use SAP Fiori App Custom Code Migration in the cloud with the SAP BTP  ABAP Environment or on-premise in an SAP S/4HANA >=1809 system.

The App performs SAP S/4HANA checks on your custom code based on remote ATC infrastructure and provides the analytical presentation of the SAP S/4HANA check results with comprehensive aggregation, filtering and navigation capabilities. Beyond this the App identifies the unused custom code based on your collected usage data, and this enables you to remove it automatically via SUM during a system conversion to SAP S/4HANA.

Using the visual predefined filters above you can group your ATC findings to get a quick overview on for example:

    • How many findings are in your used custom code (exclude unused code)
    • In which SAP S/4HANA simplification areas do you get the most findings
    • What are the most urgent findings (by priority)
    • For which findings there are Quick Fixes available and which findings you need to fix manually

From the App you can drill-down to ATC results and display affected source code of your ERP system directly in the browser.

For more details on this custom code analysis option see the blog:

Custom code analysis for SAP S/4HANA with SAP Fiori App Custom Code Migration.

The SAP Discovery Center Mission Use SAP Fiori Custom Code Migration App to Analyze Your ABAP Custom Code for SAP S/4HANA Readiness enables you to setup Custom Code Migration app in SAP BTP ABAP Environment easily using automated capabilities with CIAS (Cloud Integration Automation Service) guided workflow and execute step-by-step guided custom code analysis in your on-premise SAP ERP system.


Functional adaptation

After you did the system conversion to SAP S/4HANA with Software Update Manager (SUM) (you don’t need first to migrate the database to SAP HANA and then update the software to the SAP S/4HANA, the SUM does it in one step) we recommend to run ATC with SAP HANA and SAP S/4HANA checks. After that you need to carry out functional adaptation based on the ATC results.

Adjust modifications and enhancements

First you need to adapt the modifications and enhancements using the standard transactions SPDD, SPAU and SPAU_ENH. This is the same process as in previous upgrades within the SAP Business Suite product portfolio, only the tools SPDD and SPAU have been renewed. Especially when moving the very old system to SAP S/4HANA many modifications and enhancements can be removed or set to SAP standard. For this purpose the new UI was invented for SPAU, which supports mass activities in order to adjust modifications and enhancements or reset objects to SAP standard more easily.


                                                                        New UI in SPAU

Recommendation: Reset as many objects as possible to SAP standard.

Fix SAP HANA and SAP S/4HANA findings

Second, you need to fix SAP HANA and SAP S/4HANA findings. Adapt your custom ABAP code, using the findings of the SAP HANA and SAP S/4HANA checks (ATC results).Findings of SAP S/4HANA checks are related to S/4HANA Simplifications. Each simplification requires a different approach to solve findings. Therefore, findings of SAP S/4HANA checks refer to a SAP Note which describes how you can solve them.

SAP HANA finding example: if you selected from the table without any order and execute binary search, it will return the wrong entries, therefore you need to fix your SELECT by either providing ORDER BY statement or sort the internal table before the statement READ TABLE … BINARY SEARCH.

                                                               Fix ORDER BY

SAP S/4HANA finding example: replace your own defined material number with the SAP data type MATNR:

                                                               Fix MATNR

The TOP 10 Simplification Items


SAP NoteTopic
2215424Material number field length extension
2198647Data model changes in SD
1976487Data model changes in SAP S/4HANA Finance
2220005Data model changes in Pricing and Condition Technique
2214585Sales support is not available
2223144Foreign Trade is not available
2206980Data model changes in Material Inventory Management
2227579Storage Location MRP
2226131Public Sector specific fields in Business Partner
2296016Removal of orphaned objects

No doubt it is substantial manual effort to look at every ATC finding and adjust your custom code. Besides this very often the most ATC findings are the SAP S/4HANA standard known issues, which could be fixed quickly in the automated way.

Therefore, in order to minimize your adaptation efforts, we started to offer automatic code adaptations using the Quick Fixes (or Ctrl +1 shortcut) feature of ABAP Development Tools in Eclipse (ADT).

Currently the Quick Fixes for the most prominent SAP S/4HANA simplification use cases like MATNR extension, accesses to database tables VBFA, VBUK, VBUP, KONV, BSEG, usage of VBTYPE data elements in source code are available. Beyond this the mass-enabled Quick Fixes make it possible to adapt full packages or software components in one shot and in this way drastically reduce your custom code adaptation efforts. Check also the blog:

Semi-automatic custom code adaptation after SAP S/4HANA system conversion.


Naturally after functional adaptation you need to test your business processes (using automated testing like eCATT).

Performance tuning

After you did the system conversion to SAP S/4HANA and the system is up and running, you need to look which business processes can to be optimized on SAP HANA database, since you can now make use of full power of SAP HANA regarding performance. Therefore you need to look which SQL statements can be optimized. The SQL Monitor (ABAP SQL Monitor – Implementation Guide and Best Practices) allows you to get performance data for all SQL statements executed in your productive system. You can run it for a longer time period directly in your productive system (transaction SQLM) without major performance impact on your business processes (performance overhead < 3%). SQL Monitor helps you to understand, what are the most expensive and most frequently executed SQL statements, which SQLs read/write millions of records and provides the transparent SQL profile. SQL Monitor allows you to link the monitored SQL statements to the corresponding business processes including various aggregation and drill-down options.


                                                       SQL Monitor

As shown on the screenshot you can use for example transaction as the entry point and drill down the collected SQL runtime information to optimize SQL statements (e.g. by pushing the application logic to the SAP HANA database).

SQL Monitor Example:

Further information

For further details check the Custom Code Migration Guide for SAP S/4HANA 2023. The frequently asked questions are answered in the Custom code adaptation for SAP S/4HANA - FAQ.

79 Comments
Alvaro_AH
Explorer
0 Kudos
Hi Olga,

Quick fixes are only available on S/4 scenarios? In my case, we are migrating to a Suite on Hana first, and will jump to S/4 a bit later.

We are very interested on the ADT quick fixes assistant but looks like it is available only in S/4 environments, is this right?

Thanks in advance.
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
Hello Alvaro,

yes, the prerequisite for Quick Fixes is at least SAP S/4HANA 1809 SP00.

Regards,

Olga.
dadwal
Explorer
0 Kudos
Hi Olga,

It is very useful information.. We are facing one issue while running S4H custom code impact analysis using SPA NW 7.5. Here evaluation system is already on NW 7.50 so we followed extract based approach running - SAPRSEUB, SYCM* programs to download extract from NW 7.50 & again imported it into same NW 7.5 system.

While running program - SYCM_DISPLAY_SIMPLIFICATIONS to get the simplification result it running for ever & not showing up results. Even I scheduled the job & execution time is already above 2k sec. Generally this take very little time to show results.

Can you please assist here.. why it is not showing simplification results. here evaluation system is on SAP NW 7.5

 

Thanks & Regards

Rajesh Dadwal
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Rajesh,

for such types of issues please open a ticket to SAP.

Best Regards,

Olga.
muzaffer_gokbudak
Participant
0 Kudos
hi;

my system is also 752 but ı cant see S4HANA_READINESS  variant ın atc
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Muzaffer,

is the S4HANA_READINESS_REMOTE check variant available? It it a central ATC system or development system?

If it is a central ATC system, then please ensure, that all technical requirements of the https://blogs.sap.com/2016/12/13/remote-code-analysis-in-atc-technical-setup-step-by-step/ are fulfilled and the SAP Notes are applied.

If it is a development system, connected to a central ATC system, then please ensure, that all technical requirements of the https://blogs.sap.com/2017/02/27/remote-code-analysis-in-atc-for-developers/ are fulfilled and the SAP Notes are applied.

Regards,

Olga.
muzaffer_gokbudak
Participant
0 Kudos
hi again ,

S4HANA_READINESS_REMOTE   variant is also available in my system , its a Central ATC system and all SAP notes done. maybe ı overlook some notes but ı dont think so.

thanks Olga
werner_deistler
Discoverer
0 Kudos


Hello Olga,

we need to convert (not an ERP but) a decentral EWM to S4/Hana. Are there helpful tools for custom code checking for such a EWM conversion?

Best regards,

Werner Deistler

OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Werner,

not yet, since there is no conversion path from standalone EWM to embedded EWM in S/4HANA.

Kind Regards,

Olga.
0 Kudos
Hi Olga,

Could you please provide any documents available for ECC to S4 HANA migration /Conversion ?
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Durgaprasad,

you need to look on SAP Help Portal at the SAP S/4HANA product page: https://help.sap.com/viewer/product/SAP_S4HANA_ON-PREMISE/1909.000/en-US under "Product Documentation" (e.g. Conversion Guide for SAP S/4HANA) and "Conversion & Upgrade Assets".

Regards,

Olga.
0 Kudos

Thanks for updating us about custom code adaptation process with example and analysis options.

Caroline

nicolas_posada
Participant
0 Kudos
Hi Olga,

We have searched through many differences sources whether the Custom Code adaption step in a conversion type project can be a parallel activity with the data migration activities but unfortunatelly, our verifications have been unsuccessful. This would mean several weeks of work that we could save if we do this activities in parallel, could you please let us know what you know about this?

 

Nicolás.
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
Hi Nicolas,

do you mean the whole custom code adaptation process or only the functional adaptation step? Custom code adaptation itself is independent from data migration, you can do it in parallel.

Regards,

Olga.
nicolas_posada
Participant
0 Kudos
Greatly appreciated! This will save us time!
Balu483
Participant
0 Kudos

hi  olga.dolinskaja,

thanks for sharing very useful information. by reading the blog I came to know 3 ways we can check S/4 HANA readiness. but how to use each option?  could you please explain in detail.

  1. checking with Central Check system (or) local check system
  2. checking with Custom code Migration app on-premise
  3. checking with Custom code Migration app Cloud
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Balu,

for the 1. see the blog chapters "Technical infrastructure for custom code analysis" and "Remote ATC with SAP GUI", you can also watch the video linked there. Local ATC checks for S/4HANA readiness make sense on the converted S/4HANA system if you want to adapt custom code. See for details Semi-automatic custom code adaptation after SAP S/4HANA system conversion.

The 2. and 3. relate to the same app. See the chapter "Remote ATC with SAP Fiori App Custom Code Migration" and the blog linked there in. For the setup of the app in the cloud see the blog ABAP custom code analysis using SAP Business Technology Platform

Regards,

Olga.
0 Kudos
Hi Michael,

I have executed the report to check for namespaces and all our namespaces are already registered for ATC. But i still get this message only for certain Objects (CLAS,FUGR,PROG).

we had total 162 objects in scope on which we ran remote ATC prior to conversion, but after conversion, its only possible to run it on 96 objects. remaining objects are skipped for Local ATC check.

when ran them separately, system gives below error :


can you please guide me what can be possibly wrong here.
former_member763996
Discoverer
0 Kudos
Hi Olga

Many thanks for sharing useful information.

For an upgrade from version Hana -1 to a target Hana version ex : S4 Hana 1909 to 2020)  is it necessary to use this tool ? Or can we manage this type of upgrade without this tool ?

Expecting your feedback

Thansk
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Christophe,

do you mean the upgrade from S/4HANA 1909 to S/4HANA 2020? If it is the case, then please see the IMPORTANT NOTE in the beginning of the blog. We recommend to run custom code analysis also during upgrades within the SAP S/4HANA product family, since the subsequent SAP S/4HANA versions also contain simplifications of SAP standard and the custom code must be checked against them.

Kind Regards,

Olga.
halangalibapu
Explorer
0 Kudos
Hi Olga,

Before conversion we had appended structure in table BSIS,but now after conversion BSIS is without those fields. So how to handle standard table enhancement after conversion?

Need you suggestion.

Thanks
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
I032156
Explorer
0 Kudos
olga.dolinskaja   Hi Olga, in the video clip 3:12 sec. the screen showed  which finding can go  In-App, Side-by-side, BTP ABAP or S/4HANA, is the any guided or easy way to place a recommendation among them ?  B. Rgds

 
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Chan,

there is no easy way for such decisions. Custom Code Migration app offers complexity analysis and dependency analysis to SAP standard (s. https://blogs.sap.com/2018/10/02/how-to-check-your-custom-abap-code-for-sap-cloud-platform-abap-envi...) to support your decision making, but you must review your code.  Please take a look at the Custom Extensions in SAP S/4HANA Implementations - A Practical Guide for Senior IT Leadership There is some guidance and the decision matrix provided there.

Kind Regards,

Olga.
0 Kudos
olga.dolinskaja

Hi Olga,

If I need to check the impact on all the standard SAP tables in S/4 and want to analyze the corresponding impact in my Analytics data models build in Native HANA. Could you please suggest a way for this.

Would SYCM give me all the impacted tables (Standard) list?

 

Regards,

Praveena.
OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Praveena,

yes, you can filter the overview in SYCM by the Object Type "TABL" to get a list of all SAP standard tables impacted in S/4HANA, like this:


You can also download the result.

Kind regards,

Olga.
taryckbensaili
Participant
0 Kudos

Hi,

 

Thanks for this high level overview, however the more I read the less I undersand.

SCI, ATC and somehow ATC section of Readyness check is supposed to perfrom static checks aka custom code that have issue when moving to HANA or S/4HANA.

This list the whole list of "error"/issues.

 

In the other hand we have SCMON/SUSG, UPL or SQL Monitor that are in charge of registering the usage/performance in production.

These information helps to priorize the static check worklist aka don't fix custom code that is no longer used.

 

These prioritize worklist is supposed to be provided to user with SWLT transaction. Am I correct ?

Or, may be, within the readyness check result.  Am I Correct

Or does exists other transaction/tools that is available ?

 

While crawling the big picture is the overview we stuck into the detail like the prerequisites that become a real nightmare. like:

  • SAP_BASIS version or SP
  • Can't use SCMON with SWTL ? as you said "SCMON collects only the ABAP-based usage data. SWLT doesn't support SCMON result as "Coverage Data" and SCMON data cannot be mixed up against static check results."

What are the impact on the whole system of moving to this prerequisites. Aka:

  • If I move from SAP_BASIS 7xx to SAP_BASIS 7.5x (x>=2) last SP. What should I test ?
  • Do I need to move SAP_ABA & SAP GWFND to the same level or could it stay on 7XX ?
  • If I move only the developpement system from SAP_BASIS 7xx to SAP_BASIS 7.5x (x>=2) last SP, but not the Quality and the production what are the risk, will I still be able to make transport from 7.5x down to 7.xx (where xx < 50) ?
  • Will I have the same issue by moving 7.xx SPaa to 7.xx to last SP ? I mean do not change SAP_BASIS version but just upgrade SP

 

How could we use SCMON and ATC to provide a prioritized worklist if it's not possible using SWLT ?

as you said "SCMON collects only the ABAP-based usage data. SWLT doesn't support SCMON result as "Coverage Data" and SCMON data cannot be mixed up against static check results."

 

Could you provide me a blog or an overview or SAP help to understand how to get a prioritized worklist of custom code to adapt ?

Or a note synthetic one ?

 

Thanks in advance as in SAP real world/customer this kind of detailed information is really really missing (or I can't be able to find it).

OlgaDolinskaja
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Taryck,

this blog covers custom code adaptation process during S/4HANA conversion (ERP->S/4HANA) and between S/4HANA upgrades. If usage data (via SCMON/SUSG or UPL) was collected, it can be considered for determination of the custom code, which must be adapted for S/4HANA, otherwise you need to adapt the whole custom code. See please https://blogs.sap.com/2022/09/12/get-started-with-the-abap-custom-code-migration-process/, the S/4HANA relevant part. It explains in phases what you need to do (scope->analyze->migrate->adapt). See also the mission in SAP Discovery Center  new  Use SAP Fiori Custom Code Migration App to Analyze Your ABAP Custom Code for SAP S/4HANA Readiness , which guides you step by step through the process.

Kind Regards,

Olga.

ssharma28
Participant
0 Kudos

Hi Olga, 

How do we import our aggregated data from SUSG or from Solution manager BW cubes in to ATC for custom code analysis? I have read about the import of the data into the Fiori app but we are not using fiori app. 

 

Thank you!