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

Debug the baclground job

Former Member
0 Likes
3,016

Hi all,

Greetings!

How to debug the background job? If anyone knows please let me know?

And one more doubt i have if we put the <b>BREAK-POINT</b>in code and once we execute that job in background then the program will stop at that particular breakpoint level or it will execute without stopping at the breakpoint level.

Thanking you

Best Regards

Satish

Message was edited by: satish chowdary

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,755

Hi satish,

The easiest way is to build an endless loop in your program. Then use transaction SM50, select the workprocess and go via the menu program/session->program->debugging. Set the variable to leave the loop and enjoy the debugging.

Regards,

John.

7 REPLIES 7
Read only

Former Member
0 Likes
1,755

Hi Satish.

In transaction sm37 you can mark your job. In the command field you can enter the command jdbg (jobdebugging) without a /h. Then you come into your program and system beheaves as it does in background.

Hope this helps.

wbr

Michael

Read only

Former Member
0 Likes
1,756

Hi satish,

The easiest way is to build an endless loop in your program. Then use transaction SM50, select the workprocess and go via the menu program/session->program->debugging. Set the variable to leave the loop and enjoy the debugging.

Regards,

John.

Read only

0 Likes
1,755

Hi Satish,

Check my answer in this thread for your first question. For the second, in background, program will not stop at BREAK-POINT statement or a soft breakpoint.

Srinivas

Read only

MariaJooRocha
Contributor
0 Likes
1,755

Hi,

You can see note 573128 - Debugging programs in the background:

Symptom

How can you debug a program that runs in the background?

Other terms

Background, job

Reason and Prerequisites

Information on troubleshooting

Solution

There are 3 options:

1. In SM37, select a job that has not yet been started (status 'planned' or 'released'). In addition, set a breakpoint at the point in the source code that you want to analyze when debugging. In SM37, enter JDBG in the OK code field, and select ENTER. The selected job is now started in debug mode, and the debugger initially stops in a system program. Select F8 to continue the job up to the next breakpoint.

Caution: After debugging, the job still appears in SM37 as 'planned' or 'released', but the entire job (or, more specifically, a copy of it) ran during debugging, and possible database changes are effective as a result of the job.

1. You can catch a current batch job by using SM37 (Catch active job) or SM50 (Debug program). To do this, you must be logged on to the instance on which the job is running. The job is then stopped, and you can keep it running in the debugger.

2. Use SM36 to create a job with two steps, step 1 with the BTCLOOP report and step 2 with the report to be debugged. Then release the job.

You can then debug the job in Transaction SM50. To do this, exit the endless loop in the BTCLOOP report by changing the variable i. "

Regards,

Maria João Rocha

Read only

Former Member
0 Likes
1,755

Satish

Use "jdbg" instead of "/h".

Regards,

Amey

Read only

abdul_hakim
Active Contributor
0 Likes
1,755

Hi

Select the corresponding job and type jdbg in the command window for debugging...

The system will not stop at the static break points / dynamic break points while processing in background...

Regards,

Abdul

Read only

0 Likes
1,755

Hi, when I want to debbug um backgroung, I always make it like this:

At first I put a DO into the code, for the program to stop there

data: vl_1.

DO .

if v_1 = 'X'. exit. endif .

ENDDO.

So, the program is gonna stop in this loop, and you know the exactly point that you will deddug, because the deddug in background stops in anywhere into the program.

So You go to the SM50, find out your procces, and select the following menu Program/Mode --> Program --> debbug.

I hope it help you.

Alexandre Nogueira.