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

Schedule jobs witj job open, submit and close

Hi gurus,

I need to know if there is any way to schedule various jobs using the FM job_open job_submit and job_close. Like schedule the first job for a date and a hour and schedule others jobs to run after the first job sequential.

Its this possible?

Thk in advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Nov 20, 2007 at 07:05 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 20, 2007 at 07:12 PM

    Hi

    see the sample code for the Job scheduling using the fun modules

    IF p_bjob = 'X'.

    CONCATENATE sy-cprog sy-datum sy-uzeit

    INTO jobname SEPARATED BY '_'.

    CALL FUNCTION 'JOB_OPEN'

    EXPORTING

    jobname = jobname

    IMPORTING

    jobcount = jobcount

    EXCEPTIONS

    cant_create_job = 1

    invalid_job_data = 2

    jobname_missing = 3

    OTHERS = 4.

    CALL FUNCTION 'GET_PRINT_PARAMETERS'

    IMPORTING

    out_archive_parameters = arc_params

    out_parameters = print_params

    valid = valid

    EXCEPTIONS

    archive_info_not_found = 1

    invalid_print_params = 2

    invalid_archive_params = 3

    OTHERS = 4.

    IF valid = chk.

    SUBMIT yREP WITH s_kunnr IN s_cust

    AND RETURN

    USER sy-uname

    VIA JOB jobname

    NUMBER jobcount

    TO SAP-SPOOL

    SPOOL PARAMETERS print_params

    ARCHIVE PARAMETERS arc_params

    WITHOUT SPOOL DYNPRO.

    CALL FUNCTION 'JOB_CLOSE'

    EXPORTING

    jobcount = jobcount

    jobname = jobname

    strtimmed = 'X'

    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.

    IF sy-subrc <> 0.

    • MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ELSE.

    MESSAGE i029 WITH jobname.

    ENDIF.

    ELSE.

    MESSAGE s000 WITH text-003.

    STOP.

    ENDIF.

    ENDIF.

    Regards

    anji

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 20, 2007 at 07:20 PM

    To schedule a job on perticluar time you can use these parameters:

    FM: <b>JOB_OPEN</b>

    TBTCJOB-SDLSTRTDT = '20071122'. " << your schdule start date

    TBTCJOB-SDLSTRTTM = '122233'. " << your schdule start time

    Regards,

    Naimesh Patel

    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.