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

SM36. Background job scheduling.

Hi Friends,

How to schedule a job in background by using SM36.

and wht is <b>job steps</b>

Thanks

Guru.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 06:18 AM

    call funcatio.

    ****Open a job to submit the Post Program into

    call function 'JOB_OPEN'

    exporting

    jobname = jobname

    importing

    jobcount = jobcount

    exceptions

    cant_create_job = 1

    invalid_job_data = 2

    jobname_missing = 3

    others = 4.

    if sy-subrc <> 0.

    raise job_open_failed.

    endif.

    submit zefu_currency_load_callbak_ack

    via job jobname

    number jobcount

    with com_num = com_num

    with relay_nu = relay_num

    and return.

    if sy-subrc <> 0.

    raise job_step_failed.

    endif.

    ****Close the Job and start it immediately

    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

    others = 8.

    if sy-subrc <> 0.

    raise job_close_failed.

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 06:18 AM

    Hi

    welcome to SDN forum

    Create a Variant for the Program and

    Schedule JOB in background:

    Go to SM36 create a Job

    enter Program and Variant for that program in STEP..

    click on Start Condition

    Click on DATE and TIME enter date scheduled Start and END times

    click on Period Values

    Click on HOURLY/WEEKLY etc

    CLick on RESTRICTIONS also to use further criteria.

    so your job will be scheduled and run as per your requirement.

    and in SM37 Transaction check the status of that JOB

    Check this link for scheduling jobs..

    http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm

    You can also use the fun modules JOB_OPEN,JOB_CLOSE etc for job

    scheduling

    Regards

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 06:20 AM

    SM36, select job step wizard from app tool bar, it will take u through some predefined steps

    Suppose u have to execute more than 1 program to aacomplish one task, the individual executions will beome steps of the same job

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 06:21 AM

    Hi

    see this

    Create a Variant for the Program and

    Schedule JOB in background:

    Go to SM36 create a Job

    enter Program and Variant for that program in STEP..

    click on Start Condition

    Click on DATE and TIME enter date scheduled Start and END times

    click on Period Values

    Click on HOURLY/WEEKLY etc

    CLick on RESTRICTIONS also to use further criteria.

    so your job will be scheduled and run as per your requirement.

    and in SM37 Transaction check the status of that JOB

    Check this link for scheduling jobs..

    http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm

    <b>through program</b>

    call funcatio.

    ****Open a job to submit the Post Program into

    call function 'JOB_OPEN'

    exporting

    jobname = jobname

    importing

    jobcount = jobcount

    exceptions

    cant_create_job = 1

    invalid_job_data = 2

    jobname_missing = 3

    others = 4.

    if sy-subrc <> 0.

    raise job_open_failed.

    endif.

    submit zefu_currency_load_callbak_ack

    via job jobname

    number jobcount

    with com_num = com_num

    with relay_nu = relay_num

    and return.

    if sy-subrc <> 0.

    raise job_step_failed.

    endif.

    ****Close the Job and start it immediately

    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

    others = 8.

    if sy-subrc <> 0.

    raise job_close_failed.

    endif.

    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.