ABAP debugger stop at modification

As ABAP developer you can be asked to help out with issues in standard SAP to help debug the issue.

First of all, you normally use the ANST tool to check if there are any standard SAP notes available.

The second step is to search for user-exits and BADI’s for a transaction.

The third step you can do is use the new ABAP debugger script to search for customer enhancements during debugging. To do this, load the new script by applying OSS note 3415810 – New ABAP Debugger Script RSTPDA_SCRIPT_MODIFICATION.

Now start debugging like usual and go to the Script tab:

Then load the script RSTPDA_SCRIPT_MODIFICATION:

Then start the script and choose your break-point stop conditions:

Now you can check if there is any modification or custom coding interfering with standard SAP.

When no custom coding involved and issues is still persisting, you can debug, but will still be forced to file a case at me.sap.com for an SAP solution.

Update process debugging

As ABAP developer you sometime need to update a piece of ABAP code that is part of the Update logic. To get debugging done there some more actions are required.

ABAP debugging should only be done by experienced ABAP developers who know the pros and cons of debugging in Update. If you are not experience enough, stop reading and let an experienced person do the job.

Update process debugging

First set your break point in the Z code or standard code that does the update. If you run the normal transaction, you will notice this break point will not be called.

Now start your normal transaction again. Go to debug mode.

Choose menu Settings and Change debugger profile / Settings:

Select Update Debugging and press Save.

In the main transaction go to the point where you are about to save the data. Before pressing the save button, key in /h for debug. Now press the save button. you jump to debug mode. Press F8 to continue the current session. Wait a few seconds, and the update debug will start now:

The update debug starts now. Now you can debug the ABAP logic used in the UPDATE task. Please notice in the debug screen you see you are doing the UPDATE process debug on top of the screen.

If you have set breakpoints before in the correct code then these are now active.

Debug batch programs

This blog will explain how to debug a background batch program with real background mode (SY-BATCH is X).

Questions that will be answered are:

  • How to debug a running job?
  • How to debug a completed job?

Starting the debug mode for batch job

First we plan a single run of the batch job. In our example we run program RSWAITSEC which does nothing more than wait.

In SM37 show the job run:

Select the job and in the command line enter the background debug command JDBG:

Now the debugger starts first in the batch job part. Hit F7 a few time (F7 = jump back out of routine) until you reach the real program:

As you can see here the SY-BATCH variable is X, which means you are debugging with real background mode on.

SM50 background debugging

If you want to debug a running job, you have to goto SM50 and select the background process. Then choose the menu option Administration / Program / Debugging. Confirm the prompt:

Wait until the running SQL statement has completed and debug mode will start.

Please be very careful with this kind of debugging in a productive system. If you cancel the debug session there might be a rollback work statement triggered, which can cause database inconsistencies.

Reference notes

573128 – Debugging programs in the background