Skip to Content
author's profile photo Former Member
Former Member

How to schedule a background job for several time Daily

Hello there,

I need to run an ABAP program as a scheduled job to run at 4 different times daily.

For example, I have program ABC that I need to run daily at 9:15, 9:30, 10:15 & 11:30

Is there a way to achieve that other than creating multiple background jobs.

Regards

A.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 06, 2012 at 07:50 AM

    Hi Ameen,

    I explored a bit, but it is not possible to schedule one job at time as described by you. you will have to create multiple jobs.

    Regards,

    Dipesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 07, 2012 at 09:20 AM

    hi

    you can make program like below using JOB_OPEN, SUBMIT, JOB_CLOSE

    REPORT zaatest.

    DATA: jobname LIKE tbtcjob-jobname VALUE 'ZAA_PROG',

    jobcount LIKE tbtcjob-jobcount,

    host LIKE msxxlist-host,

    starttimeimmediate LIKE btch0000-char1 VALUE 'X'.

    TYPES: BEGIN OF ty_schedule,

    strtdt TYPE btcsdate,

    strttm TYPE btcstime,

    END OF ty_schedule.

    DATA : it_schedule TYPE TABLE OF ty_schedule,

    wa_schedule TYPE ty_schedule.

    wa_schedule-strtdt = '20121108'.

    wa_schedule-strttm = '091500'.

    APPEND wa_schedule TO it_schedule.

    CLEAR : wa_schedule.

    wa_schedule-strtdt = '20121108'.

    wa_schedule-strttm = '093000'.

    APPEND wa_schedule TO it_schedule.

    CLEAR : wa_schedule.

    wa_schedule-strtdt = '20121108'.

    wa_schedule-strttm = '101500'.

    APPEND wa_schedule TO it_schedule.

    CLEAR : wa_schedule.

    wa_schedule-strtdt = '20121108'.

    wa_schedule-strttm = '103000'.

    APPEND wa_schedule TO it_schedule.

    CLEAR : wa_schedule.

    LOOP AT it_schedule INTO wa_schedule.

    * Job open

    CALL FUNCTION 'JOB_OPEN'

    EXPORTING

    delanfrep = ' '

    jobgroup = ' '

    jobname = jobname

    sdlstrtdt = sy-datum

    sdlstrttm = sy-uzeit

    IMPORTING

    jobcount = jobcount

    EXCEPTIONS

    cant_create_job = 01

    invalid_job_data = 02

    jobname_missing = 03.

    IF sy-subrc NE 0.

    "error processing

    ENDIF.

    * Insert process into job

    SUBMIT zaa_prog AND RETURN

    USER sy-uname

    VIA JOB jobname

    NUMBER jobcount.

    IF sy-subrc > 0.

    "error processing

    ENDIF.

    * Close job

    CALL FUNCTION 'JOB_CLOSE'

    EXPORTING

    jobcount = jobcount

    jobname = jobname

    sdlstrtdt = wa_schedule-strtdt

    sdlstrttm = wa_schedule-strttm

    * STRTIMMED = ' '

    EXCEPTIONS

    cant_start_immediate = 1

    invalid_startdate = 2

    jobname_missing = 3

    job_close_failed = 4

    job_nosteps = 5

    job_notex = 6

    lock_failed = 7

    invalid_target = 8

    OTHERS = 9

    .

    CLEAR : wa_schedule-strtdt,

    wa_schedule-strttm.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 07, 2012 at 04:40 AM

    Hi Ameen,

    If you want to schedule a job for programe at frequency of 15 mins you can do that no need to create new jobs for same programe.

    Go to SM36

    In Start condition you can find the different options like imidiate , Date and Time , After job etc. I think Date and time will suit your requirement

    In this screen there is option Perodic job. Just tick it and select perodic value and give the time interval in ur case 15 mins

    Hope this resolves your issue.

    Regards


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Dear Ritz HCM,

      Periodic jobs are defined to go beyond the periodic boundries of 1hr,1day,1week,1year,etc..If you set the periodic job with special period as 15 mins, then after every 15 minutes the job will run. It will not skip the period after the 4 jobs are done, as per Ameen's requirement.

      Regards,

      Dipesh

  • Posted on Nov 29, 2012 at 07:32 PM

    Hello Ameen,

    An external job scheduler is capable of running a job at 4 different times daily.

    You can see a list of schedulers in:

    http://ecohub.sap.com/software

    then search for "job scheduler"

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 28, 2016 at 12:30 PM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.