Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Debugging in back ground

Former Member
0 Likes
4,489

Hi All,

How to debugg a program which is run in background.

Thanks,

Raju

6 REPLIES 6
Read only

Former Member
0 Likes
4,163

Hi Raju,

Goto TCode - SM50 , You can debug the Background program.

Select the program from the list using the check box and then

Go to menu Program/Mode ->Debugging ->Debug program

Choose Yes. It takes you to debugging mode.

<b>

***Reward Points if Useful</b>

Regards

Gokul

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
4,163

Here is tip. Put an endless loop in your program which is running in background.

WHILE Sy-SubRc = 0.
 Check SY-SUBRC = 0.
ENDWHILE.

Now run the program in background.

Go to SM50 and find which background process is running your program.

Select it and choose from the menu, Program/Session->Program->Debugging

The debugger will lauch and and most likely it will be stuck in your endless loop, change the value of SY-SUBRC within the debugger and continue debugging.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
4,163

Hi,

You can debugg the program using <b>'/JDBG'</b>. This command has to be types in the command box.

Cheers

VJ

Read only

Former Member
Read only

Former Member
0 Likes
4,163

Raju,

GOTO tcode SM50 ---> select your session >ON menu bar "program/session" -


>program--> Debugging.

Pls. reward if useful.

Read only

Former Member
0 Likes
4,163

You can do it in either of two ways, which method to use depends on problem at hand, whether you need to debug in a place where you have no developer access (for example test SAP system)

1. Put an infinite loop in the program at a point from which you want to debug, so you would need to either change/copy modify the program

DO.

IF FLAG = 'X'.

EXIT.

ENDDO.

So when you schedule that program in bg, it will run indefinitely allowing you to see its process running in SM50, you can see program name there. In the menu goto Program -> debugging. You will get into your program at the code you just entered. Change variable FLAG = 'X'. Continue debugging. Good luck.

2. If you cannot change the program with inserting a infinite loop as above, you can schedule the program and while it executes catch it in SM37, select the job line and in OK code field type JDBG and enter. It should take you into debugger