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

how we will use these Job_open and Job_submit job_close??

Hi Experts,

i am new in Developement, i need one help here my problem is

I have one issue which is a report here i am getting the data into internal table, that data fetching i want to schedule it in background job..

can any body tell me how can i use the JOB_OPEN and JOB_SUBMIT function modules....

plz provide any example..

Thanks in Advance,

Venkat N

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 12:14 PM

    Hi,

    Here is the sample program

    *Submit report as job(i.e. in background)

    data: jobname like tbtcjob-jobname value

    ' TRANSFER TRANSLATION'.

    data: jobcount like tbtcjob-jobcount,

    host like msxxlist-host.

    data: begin of starttime.

    include structure tbtcstrt.

    data: end of starttime.

    data: starttimeimmediate like btch0000-char1.

    • 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 zreport and return

    with p_param1 = 'value'

    with p_param2 = 'value'

    user sy-uname

    via job jobname

    number jobcount.

    if sy-subrc > 0.

    "error processing

    endif.

    • Close job

    starttime-sdlstrtdt = sy-datum + 1.

    starttime-sdlstrttm = '220000'.

    call function 'JOB_CLOSE'

    exporting

    event_id = starttime-eventid

    event_param = starttime-eventparm

    event_periodic = starttime-periodic

    jobcount = jobcount

    jobname = jobname

    laststrtdt = starttime-laststrtdt

    laststrttm = starttime-laststrttm

    prddays = 1

    prdhours = 0

    prdmins = 0

    prdmonths = 0

    prdweeks = 0

    sdlstrtdt = starttime-sdlstrtdt

    sdlstrttm = starttime-sdlstrttm

    strtimmed = starttimeimmediate

    targetsystem = host

    exceptions

    cant_start_immediate = 01

    invalid_startdate = 02

    jobname_missing = 03

    job_close_failed = 04

    job_nosteps = 05

    job_notex = 06

    lock_failed = 07

    others = 99.

    if sy-subrc eq 0.

    "error processing

    endif.

    Regards

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 12:16 PM

    If you just want to run your program as it is, not triggered from another program you do not need any code. Go to transaction SM36 and define a periodic job with your program in the step.

    regards,

    Nick

    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.