ABAP Source Code Scan Program

Introduction

When making changes to a custom field added to a database table—such as increasing the field length—it is critical to understand where and how that field is being used across the system. This step is an essential part of impact analysis and helps reduce the risk of runtime errors, dumps, or unexpected behavior.

SAP provides a very useful tool to identify these dependencies efficiently.

Solution: ABAP Source Code Scan

SAP delivers a standard program called RS_ABAP_SOURCE_SCAN that can be used to scan ABAP source code for references to a specific field.

You can execute this program via:

  • Transaction: SE38
  • Program: RS_ABAP_SOURCE_SCAN

 

By running this program, you can quickly identify all programs, function modules, classes, and other ABAP objects where the custom field is referenced. This allows you to assess the impact of the change before transporting it to higher environments.

Benefits

  • Faster and more reliable impact analysis
  • Reduced risk during table and field modifications
  • Better visibility into custom code dependencies

Using this approach ensures safer and more controlled changes to custom fields in SAP systems.

 

Executing source code scan program

  • Go to transaction – SE38 and enter the program “RS_ABAP_SOURCE_SCAN”

 

  • Execute it using button or pressing the key “F8”
  • You will be able to see the below selection screen

 

  • Under field “String searched for” maintain your Z field which needs to be scanned. If you want only to scan custom programs, then you can put “Z*” under field “Program Name” as well.
  • If you want to ignore commented lined, then mark the tick box under below filed
  • If you want to see 5 lines above and below of your string, then you need to put 5 there.
  • For more info on the program, please click on the button in the selection screen.

 

  • For example, I am going to search the string – “ZSHIPDATA” and want to see 5 lines above and below the line which contains this string. Therefore I maintain below selection screen for my requirement.

 

  • Once executed, my output looks as below!

 

From the output I can analyze where my field has been called. I can even jump to the code from the same output screen as well. You just have to click on the line.

  • Please note program “RPR_ABAP_SOURCE_SCAN” is no longer in use. You have to use the new program “RS_ABAP_SOURCE_SCAN” for this purpose.
  • For more info on this program, please refer to the OSS note 1492058 – Problems with variants for the report RPR_ABAP_SOURCE_SCAN
  • If you have lot of programs to scan (Lot of time taken to execute), please schedule this program as a background job using menu option Program / Execute in Background

 

Disclaimer

This article is done based on my research and readings, unless otherwise stated. The views expressed are my own and not of anyone else.

Author accepts no liability for the content of the articles in this website or for the consequences of any actions taken on the basis of the information provided. Using this information is at the users own discretion and responsibility.

  • If you want to see only the line which contains your string, then maintain value “0” in the “Found Location +/- x Lines” field.
  • If you want to see 5 lines above and below of your string, then you need to put 5 there.
  • For more info on the program, please click on the button in the selection screen.

 

  • For example, I am going to search the string – “ZSHIPDATA” and want to see 5 lines above and below the line which contains this string. Therefore I maintain below selection screen for my requirement.

 

  • Once executed, my output looks as below!

 

From the output I can analyze where my field has been called. I can even jump to the code from the same output screen as well. You just have to click on the line.

  • Please note program “RPR_ABAP_SOURCE_SCAN” is no longer in use. You have to use the new program “RS_ABAP_SOURCE_SCAN” for this purpose.
  • For more info on this program, please refer to the OSS note 1492058 – Problems with variants for the report RPR_ABAP_SOURCE_SCAN
  • If you have lot of programs to scan (Lot of time taken to execute), please schedule this program as a background job using menu option Program / Execute in Background

 

Disclaimer

This article is done based on my research and readings, unless otherwise stated. The views expressed are my own and not of anyone else.

Author accepts no liability for the content of the articles in this website or for the consequences of any actions taken on the basis of the information provided. Using this information is at the users own discretion and responsibility.

Leave a Reply

Your email address will not be published. Required fields are marked *