Application Development 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: 

SM36 no start after value gets extended automatically

Former Member
0 Kudos

Dear Experts,

I want to insert record into my ztable for every minute between 15:40 and 16:05 on the given day, so in (SM36)start condition selected date/time button and given values 15:40 in SCHEDULED START field and 16:05 in NO START AFTER field, and checked the periodic job check box, and in periodic values have given for every one minute, but the values in Scheduled start and * No Start After* fields gets extended automatically, so that my application inserts records continuously for every minute after the given time also, then I deleted all the entries from SM37 which contain job name given by me. Can anybody say wat is the problem* that the time gets extended* and is it the right way to delete jobs to stop scheduled job and finally how can schedule an RFC.

Thank you

Srinivas.........

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

the sap job scheduling system is rather simple. You cannot indicate an end date/time. It is periodic infinitely. The "no start after" is just in case the job does not start at the requested time (you have no guarantee that it really starts at this time, for example all workprocesses are busy).

A workaround can be to test the time in your program, and end immediately if it does not match the interval. It has the inconvenient that the jobs are still running. You may also change the scheduled time of the next scheduled job. But do it well, there is a risk that the next job starts while you are trying to change its date/time.

9 REPLIES 9

Former Member
0 Kudos

Hi,

Just try like this.. i am not sure...

When you give the start date and time , Just do not give the No start after-date and time.

Click on Periodic values button and enter the Other time: 1 minute and save it.

Hope this works

Regards

Shiva

0 Kudos

Hai Shiva,

Thank you for ur response, if we dont give no start after value means we r not specifying the end time so it gets

executed continuously for every minute, so we defenitely need to give that value...........and another thing is deleting jobs in SM37 to stop scheduled job - is it the correct way of stoping scheduled job or is there any way to stop. can we schedule an RFC in background.

Thank you,

Regards

Srinivas

Sandra_Rossi
Active Contributor
0 Kudos

the sap job scheduling system is rather simple. You cannot indicate an end date/time. It is periodic infinitely. The "no start after" is just in case the job does not start at the requested time (you have no guarantee that it really starts at this time, for example all workprocesses are busy).

A workaround can be to test the time in your program, and end immediately if it does not match the interval. It has the inconvenient that the jobs are still running. You may also change the scheduled time of the next scheduled job. But do it well, there is a risk that the next job starts while you are trying to change its date/time.

0 Kudos

Hai,

Thank you........

So can we confirm for wat u said........., please answer my question is it the right way to delete jobs from SM37 to stop periodically scheduled job and can we schedule an RFC directly without calling it in a report........

Regards,

Srinivas....

0 Kudos

What I was suggesting was not to delete the scheduled job, but just change the start date when you detect that the time limit is reached, but if you prefer, you can delete and reschedule it. You cannot schedule an RFC, you must call a report (I think we cannot answer well your question, what do you want to do exactly?)

Are you sure your company doesn't own an external job scheduler which should do the "job" very well?

0 Kudos

hi,

Actually I'm new to this, I have scheduled my job through the options given in the wizard, you are saying that change start date, to which value we need to set the start date........ if we set that date value in past it gives error. and one more I dont know external job scheduler also, ......... sorry if u r vexed with my problem

Thank you

0 Kudos

Okay, I think I am not clear.

You create a job, with restart every 1 minute, with a step which calls your custom program.

When the job starts, SAP automatically schedules another job with same name but different job number, but with a scheduled time one minute later, and at the same time it starts the report for the current job.

The custom program has to test whether it runs within the time interval you want.

If it's within the interval, that's fine, let it do his "job"

If it's out of the interval, it has to read current job number (GET_JOB_RUNTIME_INFO) and read the job that was automatically scheduled (which is in status Scheduled) via BP_JOB_SELECT (or select in TBTCO table), and change its scheduled date/time via BP_JOB_READ + BP_JOB_MODIFY.

instead of modifying, you may of course do BP_JOB_DELETE + BP_JOB_CREATE, it's up to you (I prefer the MODIFY).

About BP_JOB_* function modules, look at sap library.

0 Kudos

ok........

Thank you.... I understood the problem.....

Former Member
0 Kudos

Dear Sandra Rossi

how can I use (BP_JOB_MODIFY) I don't know how can I start this function or which tcode can I start with

Thanks.