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

How to submit a Program in Background without wait ?

hi experts,

I have one requirement in which i want to call another executable program from one program by passing some parameters to the calling program from called program. <b>I dont want to wait till the executatio of the calling program gets over.</b>i just want to submit the program & <b>wants to continue with my calling program</b>.

i am not bothered with the results of the called program.

How to do this...

if possible pl. send me the code. especially i am using some parameters & internal tables to be passed to the called program from calling program.

Regards,

Umesh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 09:55 AM

    Hi,

    This can be done by using SUBMIT.......RETURN stattement . By this ABAP statement you can execute the program from some other program .

    Example:

    SUBMIT z_report

    USING SELECTION-SET ps_variant " variant name of the report

    AND RETURN.

    I think this solve ur problem ...... Award points!!!!.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      what i read from help is the RETURN will only send back the control to the Calling program. But Actually it will wait till the execution of Called program gets over.

      Pl. correct me if i am wrong.

      I dont want to wait till the execution of Called Program.....

      pl. suggest.

      Regards,

      Umesh

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 10:03 AM

    for this use immediate option whixh is their in SM36

    plz reward points if helps.

    regards,

    rahul

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 10:05 AM

    You will need to look at the syntax of the SUBMIT statement, particularly the option VIA JOB. This can be used to create a job running your program and immediately return to your calling program.

    Regards,

    Nick

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 10:19 AM

    Hi Umesh,

    Nick Youngs answer looks best of all.

    An alternative could be to put the functionality into a function. This function must be remote-enabled and called by your program using the addition STARTING NEW TASK.

    I just put a sample program for parallel processing in the WIKI code gallery.

    https://wiki.sdn.sap.com/wiki/display/Snippets/Easilyimplementparallelprocessinginonlineandbatchprocessing">parallel processing</a>

    Regards,

    Clemens

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 10:36 AM

    Hi Umesh,

    You can exectue the progrm directly by choosing option Execute in background in option Program at the top of ABAP Editor screen. After that it will ask the variant for which you want to execute the program . Give that and choose the option "Ececute immidiately". Now go to transaction SM36 and in job discription give your program name and check in job log and spool about the status of your program.

    Please award points if useful !!!!!!!!

    Tahnks & Regards,

    Dipika

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 11:13 AM

    Hi Umesh,

    This can be achieved using

    SUBMIT ... VIA JOB job NUMBER n statement and return.

    This statement just schedules a job in background and returns the control to the calling program and does not wait for the called program's execution.

    whereas in

    SUBMIT... ... and RETURN (i.e. Without VIA JOB)

    control is returned to the calling program after the execution of the called program.

    Regards,

    Uma

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Umesh,

      You can schedule a job programatically .. Please find below the steps..

      This will schedule a background job (and this you can view in Sm37) and returns control to the calling program.

      DATA: jobnumber TYPE tbtcjob-jobcount,

      jobname TYPE tbtcjob-jobname.

      • Set the job name

      jobname = 'xxx'.

      CALL FUNCTION 'JOB_OPEN'

      EXPORTING

      jobname = jobname

      IMPORTING

      jobcount = jobnumber

      EXCEPTIONS

      OTHERS = 0.

      SUBMIT reportname USER sy-uname

      VIA JOB jobname

      NUMBER jobnumber

      WITH param1 = "fill the parms/sel fields with new values

      WITH Param2= "fill the parameters/sel fields

      AND RETURN.

      CALL FUNCTION 'JOB_CLOSE'

      EXPORTING

      jobcount = jobnumber

      jobname =jobname

      strtimmed = 'X'

      EXCEPTIONS

      OTHERS = 0.

      Thank You.

      Regards,

      Uma

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 09:02 AM

    Thanx a lot Uma...

    you have understood my problem very well & suggested a soluation which i have used & my problem got solved.

    i have awarded some points to you...

    Thanx a lot....

    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.