---
title: How to Evaluate Custom Code Usage Data Ahead of An SAP S/4HANA Migration
description: Look at the two ways you can explore your custom code in SAP ERP to ensure you know what to change or remove prior to an SAP S/4HANA migration.
image: https://blog.sap-press.com/hubfs/How%20to%20Evaluate%20Custom%20Code%20Usage%20Data%20Ahead%20of%20an%20SAP%20S4HANA%20Migration.png
---

[![rheinwerk-sappress-logo-header-1](https://blog.sap-press.com/hubfs/rheinwerk-sappress-logo-header-1.svg)](https://blog.sap-press.com/) [Blog](https://blog.sap-press.com)

- Books 
    - Get an overview of our books and courses on every relevant SAP topic. 
          - [Programming](https://sap-press.com/programming/)
          - [Administration](https://sap-press.com/administration/)
          - [BI](https://sap-press.com/business-intelligence/)
          - [Finance](https://sap-press.com/finance-controlling/)
          - [Logistics](https://sap-press.com/logistics/)
          - [HR](https://sap-press.com/human-resources/)
          - [CRM & Sales](https://sap-press.com/marketing-sales/)
          - [HANA](https://sap-press.com/hana/)
          - [Introductions](https://sap-press.com/introductions/)
          - [E-Bites](https://sap-press.com/e-bites/)
          - [Certification Guides](https://www.sap-press.com/certification-guides/)
          - [Rheinwerk Courses](https://www.sap-press.com/online-courses/)
- Book Subscription 
    - Get unlimited access to all SAP PRESS books! 
          - [SAP PRESS Subscription](https://sap-press.com/subscriptions/)

[Programming](https://blog.sap-press.com/tag/programming)

# How to Evaluate Custom Code Usage Data Ahead of An SAP S/4HANA Migration

![SAP PRESS](https://blog.sap-press.com/hubfs/Twitter_profile_pic.svg)  by [SAP PRESS](https://blog.sap-press.com/author/sap-press)

When preparing for an SAP S/4HANA migration, you’ll want to check usage data to see how much of your custom code is being used.

 

Once you’ve collected usage data, you’ll want to do two things: first, look at the detailed view of recent history via Transaction SCMON. Then, look at the long-term history aggregated in Transaction SUSG.

## Evaluating Transaction SCMON Results

In Transaction SCMON, click the **Display Data** icon at the top of the screen. Up will come a screen full of selection options, as shown in the figure below. The clever thing is that the *from* and *to* dates will default to the earliest and latest dates of the collected data.

 

![Displaying Data](https://blog.sap-press.com/hs-fs/hubfs/1994_02_004.png?width=1270&name=1994_02_004.png)

 

Here, fill out the following areas:

- **Calling Request Entry Points:** In **Type**, your options are to enter “U” for a URL that calls some code or “T” for a transaction code.
- **Called Objects:** In **Type**, enter the TADIR type of the object being called—for example, “CLAS” for a class.
- **Called Procedures:** In **Type**, enter “FORM” or “METH” or “FUNC”, depending on what exactly the program (or class) is calling.

 

If you don’t fill in anything except the dates and click **Execute**, then you’ll see a gigantic list, which is most likely far too detailed to give you any meaningful information.

 

Because you’re just interested in custom code, enter “Z\*” in the **Name** selection option in the **Called Objects** box, then run the program. As you can see below, the results are very detailed indeed.

 

![ABAP Call Monitor Results](https://blog.sap-press.com/hs-fs/hubfs/1994_02_005.png?width=1798&name=1994_02_005.png)

 

For just seeing what Z programs, functions, and classes are called, this is a bit too detailed. It could be potentially useful for seeing what FORM routines or methods are actually called, however. If a subroutine of some sort is called a lot, then it’s worth asking if it should have a unit test added to ensure its robustness going forward.

 

 

If a subroutine is never called ever, then maintaining it at upgrade time is a waste. I’ve seen many programs with subroutines called by a user command that was removed from the main screen of the application 10 years ago and so can never possibly be called again. In such cases, delete (not just comment out) the code. Chances are the very next week someone will raise a change request to have that 10-year-old functionality back again, but if they do, you still have the code in the version management system.

 

## Evaluating Transaction SUSG Results

Now it’s time to look at all that aggregated data collected by Transaction SUSG to see what Z code is being used. However, it isn’t that easy. Per SAP, “You cannot display the aggregated usage data (neither in SUSG nor in SCMON or /SDF/SCMON). A remote enabled API is provided to read the aggregated usage data which you can use to implement your own display or extractor.”

 

In other words, the standard SAP system will store the usage data for you, but if you want to actually look at it, write something yourself. All right, then, that shouldn’t be the end of the universe. Programmers, after all, like writing programs. If SAP doesn’t feel like giving them a program to look at the aggregated data, then the programmers can just write one themselves.

 

The aggregated data is stored in assorted database tables (SUSG\_DATA and all its friends) using the same sort of star schema data model that SAP BW uses (i.e., the core tables just contains numbers, and other tables are used to convert each of those numbers into the real data). There is a function group called SAPLSUSG\_API, which has function modules that presumably read the data back, but of course none of those modules are documented. Luckily, looking at the data is as simple as looking at Transaction SE16 for [CDS view](https://blog.sap-press.com/abap-sql-versus-cds-views-and-amdps-what-to-use#cds-views) SUSG\_V\_DATA, and of course you can use that as the data source for a custom ABAP List Viewer report.

 

When you use Transaction SE16 on SUSG\_V\_DATA just asking for the number of entries, the result takes about five minutes to come back—for one day’s worth of usage on a system where you are the only user and ran a grand total of two transactions.

 

To know what custom Z programs, classes, and functions were called during the last year, if you have had Transaction SUSG running for that period, then probably the simplest thing to do is execute Transaction SE16 on table SUSG\_PROG with the PROGNAME field set to “Z\*”, as shown here:

 

![Transaction SER16](https://blog.sap-press.com/hs-fs/hubfs/1994_02_006.png?width=1253&name=1994_02_006.png)

It is close to 100% likely that with a year’s worth of data, even though it’s aggregated, running Transaction SE16 on that table will time out if it’s run in the foreground (even though there’s an index on field PROGNAME). So you can execute this in the background, then look at the resulting spool request and download that to Excel, or write a small ABAP List Viewer report to email you the result in a spreadsheet and run that in the background. The latter might be overkill, though.

 

Whichever method you choose, the end result will look like the figure below—just about a billion times longer.

 

![Results](https://blog.sap-press.com/hs-fs/hubfs/1994_02_007.png?width=1803&name=1994_02_007.png)

 

The last two columns are the important ones: the object type and the name. You want to end up with several spreadsheets containing big lists. The first one would be a Transaction SE16 dump from table TADIR with all your Z programs and classes, the next a similar list from table TFDIR listing all your Z function modules, and lastly the list from Transaction SUSG saying which of those objects are actually used.

 

With a bit of Microsoft Excel wizardry, you can compare those lists to see what Z items have actually been used in the last year. Naturally, since all the data comes from [ABAP](https://learning.sap-press.com/abap)tables, then the same thing can be achieved using a program. (The author of the E-Bite this post comes from, Paul Hardy, has written such a program. The code can be found on this site: [https://github.com/hardyp/S4HANA-ABAP-Code-Conversion](https://github.com/hardyp/S4HANA-ABAP-Code-Conversion).)

 

The end result is that you have a big list of the 60% to 75% of your custom code objects that are never called. The question is next what to do with such dead code walking. If you use [SAP Solution Manager](https://learning.sap-press.com/sap-solution-manager), there’s a recommended process for retiring such code.

 

One approach is to keep the unused code for the time being (just to be on the safe side) but change the package assignment of such code to ZZZ\_OBSOLETE\_OBJECTS (keeping a note of what the original package assignment was). If you’re lucky enough that your organization uses packages properly, it may be vital to keep the original package assignment somewhere other than some sort of spreadsheet external to SAP, so you might need to create some sort of shadow package hierarchy to move the dead objects to, but that would be a lot of work for no real benefit.

### Conclusion

The custom code you’ve added to your existing [SAP ERP](https://learning.sap-press.com/what-is-sap/#sap-erp) system must be checked and, in some cases, updated before moving it to an [SAP S/4HANA](https://learning.sap-press.com/sap-s4hana) system. In this blog post, we took a look at the monitoring process and identifying code that must be changed or could be removed prior to your migration.

 

*Editor’s note*: This post has been adapted from a section of the e-book [*Migrating Custom Code to SAP S/4HANA*](https://www.sap-press.com/migrating-custom-code-to-sap-s4hana_5131/?utm_source=sappressblog&utm_medium=referral&utm_campaign=Blogs&utm_term=section2&utm_content=1994)by Paul Hardy.

## Recommendation

[![Migrating Custom Code to SAP S/4HANA](https://blog.sap-press.com/hs-fs/hubfs/1994.jpg?width=170&name=1994.jpg)](https://www.sap-press.com/migrating-custom-code-to-sap-s4hana_5131/?utm_source=sappressblog&utm_medium=referral&utm_campaign=Blogs&utm_term=section2&utm_content=1994)

**Migrating Custom Code to SAP S/4HANA**

Does your organization have a lot of custom code? Are you planning a move to SAP S/4HANA? Then this E-Bite is for you! Walk through the process of migrating your code from SAP ERP to SAP S/4HANA, starting with a code analysis to identify unused custom code, underperforming SQL queries, and non-robust code. Then implement fixes, from changing field lengths to figuring out what to do about code related to deprecated modules. Time to prepare for SAP S/4HANA!

[Learn More](https://www.sap-press.com/migrating-custom-code-to-sap-s4hana_5131/?utm_source=sappressblog&utm_medium=referral&utm_campaign=Blogs&utm_term=section2&utm_content=1994)

![SAP PRESS](https://blog.sap-press.com/hubfs/Twitter_profile_pic.svg)

**by [SAP PRESS](https://blog.sap-press.com/author/sap-press)**

SAP PRESS is the world's leading SAP publisher, with books on ABAP, SAP S/4HANA, SAP IBP, intelligent technologies, SAP Business Technology Platform, and more!

[Programming](https://blog.sap-press.com/tag/programming) [Administration](https://blog.sap-press.com/tag/administration) [Video](https://blog.sap-press.com/tag/video)

[![Share on facebook](https://7528309.fs1.hubspotusercontent-na1.net/hub/7528309/hubfs/raw_assets/public/mV0_d-web-default-modules_hubspot/img/facebook-color.png?width=24&name=facebook-color.png)](https://www.facebook.com/share.php?u=https%3A%2F%2Fblog.sap-press.com%2Fhow-to-evaluate-custom-code-usage-data-ahead-of-an-sap-s4hana-migration%3Futm_medium%3Dsocial%26utm_source%3Dfacebook) [![Share on linkedin](https://7528302.fs1.hubspotusercontent-na1.net/hub/7528302/hubfs/raw_assets/public/mV0_d-web-default-modules_hubspot/img/linkedin-color.png?width=24&name=linkedin-color.png)](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fblog.sap-press.com%2Fhow-to-evaluate-custom-code-usage-data-ahead-of-an-sap-s4hana-migration%3Futm_medium%3Dsocial%26utm_source%3Dlinkedin) [![Share on twitter](https://7528304.fs1.hubspotusercontent-na1.net/hub/7528304/hubfs/raw_assets/public/mV0_d-web-default-modules_hubspot/img/twitter-color.png?width=24&name=twitter-color.png)](https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fblog.sap-press.com%2Fhow-to-evaluate-custom-code-usage-data-ahead-of-an-sap-s4hana-migration%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&url=https%3A%2F%2Fblog.sap-press.com%2Fhow-to-evaluate-custom-code-usage-data-ahead-of-an-sap-s4hana-migration%3Futm_medium%3Dsocial%26utm_source%3Dtwitter&source=tweetbutton&text=) [![Share on email](https://7528311.fs1.hubspotusercontent-na1.net/hub/7528311/hubfs/raw_assets/public/mV0_d-web-default-modules_hubspot/img/email-color.png?width=24&name=email-color.png)](mailto:?subject=Check+out+https%3A%2F%2Fblog.sap-press.com%2Fhow-to-evaluate-custom-code-usage-data-ahead-of-an-sap-s4hana-migration%3Futm_medium%3Dsocial%26utm_source%3Demail&body=Check+out+https%3A%2F%2Fblog.sap-press.com%2Fhow-to-evaluate-custom-code-usage-data-ahead-of-an-sap-s4hana-migration%3Futm_medium%3Dsocial%26utm_source%3Demail)

### Comments

### Latest Blog Posts

[![7 Things to Consider Before an SAP S/4HANA Migration](https://blog.sap-press.com/hs-fs/hubfs/7%20Things%20to%20Consider%20Before%20an%20SAP%20S4HANA%20Migration-1.png?height=600&name=7%20Things%20to%20Consider%20Before%20an%20SAP%20S4HANA%20Migration-1.png)](https://blog.sap-press.com/7-things-to-consider-before-an-sap-s4hana-migration)

[Administration](https://blog.sap-press.com/tag/administration)

## [7 Things to Consider Before an SAP S/4HANA Migration](https://blog.sap-press.com/7-things-to-consider-before-an-sap-s4hana-migration)

[Read More](https://blog.sap-press.com/7-things-to-consider-before-an-sap-s4hana-migration)

[![The SAP Landscape Transformation Scenario for SAP S/4HANA](https://blog.sap-press.com/hs-fs/hubfs/The%20SAP%20S4HANA%20Landscape%20Transformation%20Scenario.png?height=600&name=The%20SAP%20S4HANA%20Landscape%20Transformation%20Scenario.png)](https://blog.sap-press.com/the-sap-s/4hana-landscape-transformation-scenario)

[Administration](https://blog.sap-press.com/tag/administration)

## [The SAP Landscape Transformation Scenario for SAP S/4HANA](https://blog.sap-press.com/the-sap-s/4hana-landscape-transformation-scenario)

[Read More](https://blog.sap-press.com/the-sap-s/4hana-landscape-transformation-scenario)

**Subscribe to our blog!**Get notified about future blog updates.

- <https://www.facebook.com/sappress>
- <https://twitter.com/sappress>
- <https://linkedin.com/company/sap-press>
- <https://www.instagram.com/sap_press/>
- <https://blog.sap-press.com/rss.xml>

### The official SAP PRESS Blog

As the world’s leading SAP publisher, SAP PRESS’ goal is to create resources that will help you accelerate your SAP journey. The SAP PRESS Blog is designed to provide helpful, actionable information on a variety of SAP topics, from SAP ERP to SAP S/4HANA. Explore ABAP, FICO, SAP HANA, and more!

### SAP Blog Topics

- [All Topics](https://blog.sap-press.com)
- [Logistics](https://blog.sap-press.com/tag/logistics)
- [Programming](https://blog.sap-press.com/tag/programming)
- [FICO](https://blog.sap-press.com/tag/fico)
- [Administration](https://blog.sap-press.com/tag/administration)
- [Business Intelligence](https://blog.sap-press.com/tag/business-intelligence)
- [What Is?](https://blog.sap-press.com/tag/what-is)
- [Featured](https://blog.sap-press.com/tag/featured)
- [CRM & Sales](https://blog.sap-press.com/tag/crm-sales)
- [Video](https://blog.sap-press.com/tag/video)
- [Human Resources](https://blog.sap-press.com/tag/human-resources)

### Blog curated by

[![Rheinwerk Publishing & SAP PRESS Logo](https://blog.sap-press.com/hubfs/rheinwerk-sappress-logo-header-1.svg)](https://sap-press.com) [Visit the SAP PRESS Store](https://sap-press.com)

### About

- [Home](https://sap-press.com/)
- [About Us](https://sap-press.com/the-publisher/)
- [Contact](mailto:info@rheinwerk-publishing.com)
- [Legal Notes](https://sap-press.com/legal-notes/)
- [Privacy Policy](https://sap-press.com/privacy/)
- [Terms of Use](https://sap-press.com/terms/)
- [Guest Posting](https://blog.sap-press.com/guest-posting)

© 2026 Rheinwerk Publishing, Inc. | Change Privacy Options

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "SAP PRESS",
    "url" : "https://blog.sap-press.com/author/sap-press"
  },
  "dateModified" : "2024-02-09T14:56:45.601Z",
  "datePublished" : "2020-07-28T13:00:00.000Z",
  "headline" : "How to Evaluate Custom Code Usage Data Ahead of An SAP S/4HANA Migration",
  "image" : [ "https://blog.sap-press.com/hubfs/How%20to%20Evaluate%20Custom%20Code%20Usage%20Data%20Ahead%20of%20an%20SAP%20S4HANA%20Migration.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.sap-press.com/how-to-evaluate-custom-code-usage-data-ahead-of-an-sap-s4hana-migration",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.sap-press.com/hubfs/Logo-1.jpg"
    },
    "name" : "Rheinwerk Publishing, Inc."
  }
}
```