Skip to Content
avatar image
Former Member

stop hourly background job only for two hours

Hi Guru's

I have a requirement

There is a background job in our Production system which is scheduled to run on hourly basis regularly . i have received a new requirement to stop executing the job for between 4 pm to 7 pm only on Sunday and rest of the days it should run regularly on hourly basis

awaiting for valid inputs

Regards

Harsha

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    Apr 12, 2016 at 10:21 PM

    Hi Sri,

    I am not sure how this would work however logically I am giving my suggestion. Please try this in non-production systems and verify, if works then do the same in PRD.

    1. define calendar with all days as working days except sunday --> schedule the job on hourly basis based on this calendar

    2. Sunday until 4pm-->create one more calendar with all sundays only working day and remaining are holidays, schedule the same job , specify the option "No Start After" 4pm (only on sundays util 4pm only)

    3. Sunday after 7pm--> reuse the same calendar you have created in step 2 (calendar with all Sundays are working day), schedule the same job with different name from 7pm to hourly basis only during working days as per the created calendar (only on sundays from 7pm to end of sunday)

    On Monday, the first created job should continue the execution.

    If you have CPS in your environment, you may check options with CPS to schedule the job.

    If anybody has less complex idea, Please share here.

    Thanks,

    Pradeep

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I agree with Pradeep about defining a six day calendar for the hourly requirement. But personally, I would copy the job 22 times giving each job name a unique name like:

      JOBNAME_SUN_0100,

      JOBNAME_SUN_0200,

      JOBNAME_SUN_0300,

      .

      .

      .

      JOBNAME_SUN_1200,

      JOBNAME_SUN_1300,

      JOBNAME_SUN_1400,

      JOBNAME_SUN_1500,

      .

      .

      JOBNAME_SUN_2000,

      .

      .

      .


      I would schedule those jobs on a weekly frequency; each with their appropriate start time.

  • avatar image
    Former Member
    Apr 12, 2016 at 02:58 PM

    ANY HELP ??

    Add comment
    10|10000 characters needed characters exceeded

    • Hi

      Without the use of a scheduler (SAP Cronacle, Control-M, Dollar-U...) I only see 2 solutions

      1) Create a specific ABAP program that will check the date and run your program only if it is not Sunday between 3 to 7.

      Schedule that specific ABAP program to run hourly.

      2) Use the OS scheduler (Windows task manager or Unix Cron) to define 24 daily tasks for each hour running every day, except the tasks for 4pm to 7pm that will not run on Sunday.

      Create a specific event using transaction SM64

      The OS scheduler tasks will raise the created event running sapevt OS command

      Create your job in SAP as an event based periodic job waiting for the event you have defined.

      Periodic event based program reschedule itself automatically once it has run.

      Using Unix cron it could be possible to only define 2 tasks

      - one running every hour on Monday to Saturday

      - one running at specific hours on Sunday

      It does not seem to be possible to do the same with the Windows task manager, so on Windows => 24 tasks !

      Best regards

  • Apr 13, 2016 at 12:22 AM

    Hi Former Member,

    Yes, this is good and simple 😊 . He has to follow this,

    1. Define Calendar for weekdays including Saturday and schedule the job on hourly basis

    2. Schedule 22 jobs on weekly basis on Sundays as you suggested

    or Calendar with Sundays as working day as I have suggested.

    Thanks,

    Pradeep

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 13, 2016 at 11:32 AM

    Thank you all very much for all the valid inputs . will try and discuss all these suggestions within our team and will come up with one feasible solution 😊

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I have dealt with these kinds of impromptu scheduling change requirements from the business units for years. Without a central scheduling system like Redwood, I found that the best way to deal with these kinds of requirements was the simplest way. Create a special job or jobs. It's tedious, but less error prone.

      • If a job doesn't conform to a hourly frequency, then look at creating a series of daily jobs.
      • If a job doesn't conform to a daily frequency, then look at creating a series of weekly jobs.

      Good luck.