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

How to debug program in Background

Former Member
0 Likes
2,962

Hi Experts,

How to debug the program in background.

Thanks in Advance

Regards,

IFF

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,724

Goto SM51-> keep a cursor on user running program in background.

Then program/mode ->program ->debugging.

Alternatively what you can do it.. add few WRITE statements in your program where you want to check your values. Once program is finished.

Goto SM37 and check spool for the user. You will see value populated in your program.

8 REPLIES 8
Read only

Former Member
0 Likes
1,724

Hi

Debugging a program running in background in not possible as far as I know.

Regards

Navneet.

Read only

Former Member
0 Likes
1,724

HI,

You can debug very easily if your program that you want to debug is a custom program. You can put an endless loop in the code somewhere.

WHILE SY-SUBRC = 0.

CHECK SY-SUBRC = 0.

ENDWHILE.

Now go to SM50, select the work process that is running the program. Click Program/Session->Program->Debugging, it will then open the debugger and you will be looping at your endless loop. Change the value of SY-SUBRC to get out of the loop and debug as normal.

Thanks.

Read only

Former Member
0 Likes
1,725

Goto SM51-> keep a cursor on user running program in background.

Then program/mode ->program ->debugging.

Alternatively what you can do it.. add few WRITE statements in your program where you want to check your values. Once program is finished.

Goto SM37 and check spool for the user. You will see value populated in your program.

Read only

Former Member
0 Likes
1,724

Hi,

goto tcode SM50-- selct your process bu user name or program name>Menu bar Program/session>Program---->debugging.

Don't forget to rewar if useful......

Read only

Former Member
0 Likes
1,724

hi

<b> u cannot debug the program running in background</b> at all instead u can know its status

regards

ravish

<b>dont forget to reward if useful</b>

Read only

Former Member
1,724

Hi

You <b> Cannot.</b>

but once the job is completed in sm37 select the job and type JDBG at command box, the job will go in debug mode and show you how it was executed.

Regards

Raj

Read only

0 Likes
1,724

Thank you, you saved my day.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,724

Hi,

The best way to debugg, I will not say debug as you may not know when the program is in background, you can actually use LOGGING statements in your program which will help you to analyze the program.

Regards,

Sesh