Using the Custom Code Analyzer to Find ABAP Object Errors Ahead of SAP S/4HANA Migration

Excerpt from the book ABAP to the Future by Paul Hardy. Used with permission of SAP PRESS. All rights reserved.

In this blog, follow Paul Hardy’s instructions for testing your objects against a simplification database to see what will need to be fixed before jumping to SAP S/4HANA.

What’s that coming over the hill? It’s SAP S/4HANA!

SAP Business Suite will only be supported until 2025, and if you want to stick with SAP you’ll have no choice at that point but to move across to SAP S/4HANA, which is officially a new product as opposed to an upgrade (though I still see it as the latter). SAP has taken this opportunity to clear out the deadwood, like logical databases and other obsolete technologies, and in areas in which currently there are fifty-four different solutions for the same problem, SAP has whittled it down to one.

What this means is that lots of objects will vanish from the SAP ERP system, and if your custom code references these objects, it’ll stop working on the spot. At this point, you may be thinking it really is a monster coming over the hill; even though 2025 may seem a long way away, it’ll be here before you know it, so you had better start making plans.

How in the world are you supposed to know what will break? SAP has thought of this and come up with a custom code analyzer for this very purpose. The idea is that you run a report in your current system, which downloads a ZIP file of all your custom code. Then, you need to find a 7.5 system (easier said than done, though you can always use the trial 7.5 system in the cloud) and run yet another report, which uploads the file and performs a static analysis of all your Z code to tell you what will break in SAP S/4HANA and how to fix it. In this section, we’ll walk through the steps you need to take before you start and during the analysis, and then we’ll help you sort through the aftermath.

1 Preparation

First things first: You need to be on a certain support stack level to run the extractor in your current system — level 33 for 7.00, level 18 for 7.01/7.02, level 17 for 7.31, and level 13 for 7.4. As of July 2016, none of those support stacks have been released yet. The other important thing is that if you’re below a certain level, such as 10 or below for 7.02, you can’t import the custom code analyzer from SAP Note 2185390.

If your system has a high enough support stack level to be able to import the program from that SAP Note 2185390, but low enough that the extraction program is not there as standard, you can use SAP Note 2185390 to get the extraction program. Sadly it’s quite a painful process, as there are a few manual steps to go through first (creating SAP BASIS packages) and then a tangled web of dozens of dependent notes to be uploaded. SNOTE, used for implementing SAP Notes, will make sure they’re implemented in the correct order, but I’d forgive you if you waited until the support stack level for your system became available.

2 Usage

After SNOTE is finished, you end up with a transport with exactly 131 different objects inside it, the most important of which is a new report called SYCM_DOWNLOAD_REPOSITORY_INFO, which, amazingly, downloads repository information.

You execute the repository downloading program twice — the first time in the background because the analysis will take some time. Most likely, when you look at the log in SM37 the job will crash after one second, complaining that the where used list is not up to date. The SAP Note warns you of that, and tells you to run program SAPRSEUB in the background to fix that problem. That job will probably take quite a while to run, but when it’s finished you can run the repository info report again in the background, and this time it won’t be dead on arrival.

Once you’ve seen in SM37 that the analysis job is finished, execute the program once again, and this time click the magic Download ZIP File button. This does what it says on the tin, and you have a lovely file on your hard drive, ready to upload into a 7.5 system.

Now we come to the concept of the simplification database. This lives in the cloud, as everything worth its salt does these days, and is regularly updated by SAP as SAP keeps making changes to SAP S/4HANA. This database stores all the information about what will break and why and what you can do about it. Only a 7.5 system can read this information, though SAP is working on a cloud version so that you don’t have to get an actual 7.5 system.

If you do have access to a 7.5 system, you can execute report SYCM_UPLOAD_REPOSITORY_INFO to upload the ZIP file you just downloaded from your older SAP system. When you run the report from SE38, there is one input field with an (F4) dropdown that doesn’t do anything (easily ignored). After you have finished ignoring the dropdown, give your extraction a name like FRED, press the Execute icon and select your ZIP file. Then the screen fills up with a list of data about your custom objects — total number of “customer” objects, number of modified objects, and so on — ending with a happy shout of Upload DONE! and the fact that the upload data has been stored in various tables, starting with SYCM_CUST.

Next, you need to go to SAP Service Marketplace to download a ZIP file with the latest simplification database content. Go to https://support.sap.com/swdc and search for “CCMSIDB”. The screen in the figure below should appear, and you can download a ZIP file — the fourth entry in the screen shot, though by the time you try this, the patch level probably will have increased.

This ZIP file is uploaded into the 7.5 system using report SYCM_UPLOAD_SIMPLIFIC_INFO. If you find that the report times out, as I did, set a breakpoint in the upload program after each note is uploaded to step through the program in that manner.

The final step is to run report SYCM_DISPLAY_SIMPLIFICATIONS to show the results, and this report proudly says in its comments that it works using a CDS view — naturally! As of July 2016, none of the reports referred to in this section have transaction codes, but I bet in a few years they all will, or they’ll be added to the Custom Code Management Cockpit as new buttons.

3 Aftermath

When you get the list of all your custom objects and which ones you’ll need to change to get them to work in SAP S/4HANA, you may want to strap dynamite to yourself and jump into a live volcano, because the list is so big (see below, which shows the result from a typical customer installation; note how small the little indicator is in the slider section on the right of the screen). You’ll see that there were over eleven thousand objects that needed to be changed.

However, before you decide to end it all, bear in mind that this is a computer spewing out a big list of objects that failed an automated test; just like a Java error message, you’re seeing each error described identically a hundred (or a thousand) times in a row.

Note that one of the columns is the SAP Note number that describes the nature of the problem and what you need to do to fix it. You’ll see that there are a far fewer notes than there are rows in the report, so there are not actually eleven thousand different problems to be solved — just the same few in many places.

In the ALV report, if you click the SAP Note number, it will tell you that the note does not exist. You can go to SAP Service Marketplace and type in the note number manually to look at it, however. Hopefully, by the time you read this, the drilldown will be fixed. The notes are very helpful indeed (e.g., SAP Note 1976487 explains what you need to do in the future when reading and writing to standard SAP ERP FI/CO tables; of course, you never write to such tables as that would be naughty, but just in case you do, SAP tells you how to proceed going forward, because most of those tables no longer exist in SAP S/4HANA).

Moreover, a lot of code to read from such tables will work as is, with the database tables that have vanished either being replaced by views with the same name or, more spookily, being magically “redirected” to views with different names without you having to change a line of code.

Just as with the Code Inspector warning about code that may no longer work under an SAP HANA system, you will find some changes in these notes that you can make right now in your system to ease the pain later on when you have to make the transition.

Excerpt from the book ABAP to the Future by Paul Hardy. Used with permission of SAP PRESS. All rights reserved.

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Sign up for SAP PRESS newsletters to get even more SAP tips and tricks delivered to you monthly!