How To Debug SAP Scripts in SAP ABAP

 In this post I am going to explain you how to debug SAP Scripts.

There are two ways to debug SAP Script.

  1. Go to SE38 transaction. Enter program RSTXDBUG and execute it. A message will be displayed that debugger got activated. 

  2. Go to transaction SE71 (SAP Scripts Transaction) and in the menu click on Utilities and select Activate Debugger. So, the debugger will be activated.

Among the above two methods I prefer to use the first one. Because once you execute the standard program you don't need to worry about getting form name from the calling program or driver program. Just execute the driver or print program and automatically the SAP Script debugger gets triggered.

For example your calling program name is Z_PLANT_FORM and you want to debug the SAP Script.

As per the first method, before executing your calling program you need to execute the standard program RSTXDBUG.

If you have to go by second method then while executing the calling program you have to set a dynamic breakpoint on OPEN_FORM. In the exporting parameters you can get the form name and language. Then go to transaction SE71 and enter form name. Activate the debugger from Menu-Utilities-Activate Debugger.

From here the process is same for both methods.

Once you get the message that debugger got activated, execute the calling program Z_PLANT_FORM. You will get below popup before the SAP script debugger is displayed.

Just click OK and now the debugger is activated.

You can either go by single step or execute by pressing F5, F6 or you can use the options from screen.

The Include in Debugger is generally a standard text. This might be in hard coded form or dynamically passed from calling program. You can enter the variable in below rows to know the standard text name or any other variables that are getting passed to the form.

INCLUDE <zstandardtxt> OBJECT <txt> ID <st> LANGUAGE <lang>

where zstandardtxt refers to the Standard Text name.

You can find the standard texts in SO10 transaction using name, text id and language.

Keep in mind that the debugger will not be triggered if you execute the calling programs as background job.

There are some scenarios like F110 and F150 transaction where you enter all the data and execute the transaction in foreground. But the debugger will not be activated. Basically for some standard transactions eventhough you enter the data in foreground you have to check if it is creating background job in SM37 transaction.

If you find any job getting created you have to get the program the job has been executed for and check the job log if any form related data is getting called. You can execute that background job program in foreground by giving required data in input and activate the debugger before running the program.

This is how you can debug the SAP Script for F150 dunning forms or any other standard transactions like F110.

Hope I have given enough information about debugging of SAP scripts.

If you have any tips or any suggestions please feel free to share them in comments. 😀

Post a Comment

Previous Post Next Post