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

Continuous background job

Former Member
0 Likes
3,042

Hi Experts,

I have a requirement , where a program need to be executed as a continuous job. In the logic of the program, there is a

'Do.. EndDo' , which would be continuously running.

I have set the program as a background job, where I have a single step , which would execute the Report.

As the report has a never ending loop, it would keep running.

Now I am facing a problem. In the job log, it keeps on updating the message '1 step(s) found ( ABAP_PROGRAM: XXX ; ABAP_VARIANT: ; EXT_PROGRAM: ; STATUS: R ) '.

Though I have a single step, it is updating the message for every 20 secs in the log.

And also, I am thinking , if the job log gets overflowed or any memory issue .

Please suggest, how to stop the job log updating the same message.

Thanks & Regards,

Lalitha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,304

Hi Lalitha,

So you mean to say that there will be a single job and that job will run in infinite time ? Or in the DO while loop every time a new Job will be kicked off. I believe SAP will not allow to change the Log for any current job, there might be a locking. I think it will only allow to change or delete job log for finished jobs.

I think for job log you dont have to bother that much. How long you people want to keep that job log ?You can delete the job log older that 15 day or like this.

9 REPLIES 9
Read only

Former Member
0 Likes
2,305

Hi Lalitha,

So you mean to say that there will be a single job and that job will run in infinite time ? Or in the DO while loop every time a new Job will be kicked off. I believe SAP will not allow to change the Log for any current job, there might be a locking. I think it will only allow to change or delete job log for finished jobs.

I think for job log you dont have to bother that much. How long you people want to keep that job log ?You can delete the job log older that 15 day or like this.

Read only

0 Likes
2,304

Hi Kaushik,

Thanks for the reply.

There is only a single job which will run for infinite time

Basically, I have only one step. But why the job log keeps on updating the message, '1 step(s) found ( ABAP_PROGRAM: XXX ; ABAP_VARIANT: ; EXT_PROGRAM: ; STATUS: R ) '.

Also, if the job log is getting updated continuously, will there be any situation , where overflow problem would occur.

Ofcourse, older job log gets deleted, based on the settings. But might be overflow can happen before only.

Thanks & Regards,

Lalitha

Read only

0 Likes
2,304

Obviously you have some code in your DO loop that issues this message.

With infinite processing, of course you will hit some disk or memory limit at some point in the near or distant future...

What is the purpose of a continuously running job?

Thomas

Read only

0 Likes
2,304

HI Thomas,

In the 'Do .. Enddo' loop, there is no logic, which would issues this message to joblog.

I have cleared all the variables, internal tables etc, at the end of each loop pass, to make sure that memory limit is not exceeded.

Is this sufficient or any other measures to be taken to see that memory limit is not execeeded.

Thanks & Regards,

Lalitha

Read only

0 Likes
2,304

Hi Lalitha Bhagi,

- please check again your job definition, is STATUS: R for repeat?

- in your endless DO loop you may insert

WAIT UP TO 10 SECONDS

statement. This will reduce system load significantly. But you should have any exit condition anyway, because the WAIT sends the process to an OS SLEEP state from where it can not be interrupted or stopped.

Regards,

Clemens

Read only

Former Member
0 Likes
2,304

Hi,

When the job is active, it only show the log "Job started".

Once the job is completed or cancled then only you can see the log "Step 001 started (programXXXX...."

As you have used endless loop in your report, the log should only display "Job started".

If you are using FM job_open in your report then use FM job_close to close the background request.

Also verify how you have scheduled the job??

Regards

Praveen

Read only

0 Likes
2,304

When the job is active, it only show the log "Job started".

Once the job is completed or cancled then only you can see the log "Step 001 started (programXXXX...."

As you have used endless loop in your report, the log should only display "Job started".

No, that's not true. The visibility of the job log messages is controlled by program commits. If you execute a commit work in the program or an implicit commit at program/step end, all of the messages issued up to that point will be displayed/visible in the log.

I don't see the point of trying to keep up with a never-ending job/report. I would opt for a periodic job that runs at a certain interval and adjust the report in question - why does a report need to run forever?

Read only

0 Likes
2,304

Thanks for the valuable inputs.

I have commit statement in the program. Regarding the point that 'The visibility of the job log messages is controlled by program commits.' , but I am not getting, why the message is getting repeated.

Basically the program flow is like this.

Program continuous_report.

wait for 10 sec.

Do..

....

...

Commit work.

Enddo.

The log message is that...

16.12.2010 05:31:20 Job started

16.12.2010 05:31:20 Step 001 started (program Continuous_Report, variant , user ID XXX)

16.12.2010 05:31:30 1 step(s) found ( ABAP_PROGRAM: Continuous_Report,; ABAP_VARIANT: ; EXT_PROGRAM: ; STATUS: R )

16.12.2010 05:31:56 1 step(s) found ( ABAP_PROGRAM: Continuous_Report, ; ABAP_VARIANT: ; EXT_PROGRAM: ; STATUS: R )

16.12.2010 05:32:17 1 step(s) found ( ABAP_PROGRAM: Continuous_Report, ; ABAP_VARIANT: ; EXT_PROGRAM: ; STATUS: R )

16.12.2010 05:32:39 1 step(s) found ( ABAP_PROGRAM: Continuous_Report, ; ABAP_VARIANT: ; EXT_PROGRAM: ; STATUS: R )

.....................................

...................................

Thanks & Regards,

Lalitha

Read only

0 Likes
2,304

Hi Lalitha,

your posting behavior reminds me of a guilty politician: Reveal the truth slice by slice...

Let us know what else you do between DO and ENDDO, format all code as code (use above <> code button).

Note: WAIT interrupts the process and causes an implicit database commit. COMMIT WORK is required only for function calls IN UPDATE TASK and use of PERFORM ON COMMIT (frequently used in BAPIs).

-> You can also remove code slice by slice and observe when the job log changes...

Regards,

Clemens

Edited by: Clemens Li on Dec 16, 2010 10:03 AM