<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: background job - programs all running at the same time... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178153#M1198754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this link will help you definatly ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have checked in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_46c/helpdata/en/fa/096ce5543b11d1898e0000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_46c/helpdata/en/fa/096ce5543b11d1898e0000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Feb 2009 08:17:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-19T08:17:14Z</dc:date>
    <item>
      <title>background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178152#M1198753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;i have an issue regarding background job.i have to run multple programs in background one after another in one program.so i am using function modules job_open,submit and job_close.&lt;/P&gt;&lt;P&gt;my problem all the jobs are statrting at same time .but i want to run after completion of first job second job should start.&lt;/P&gt;&lt;P&gt;please guide me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;sai&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Julius Bussche on Feb 19, 2009 9:36 AM&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please use meaningfull subject titles&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 08:08:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178152#M1198753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T08:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178153#M1198754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this link will help you definatly ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have checked in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_46c/helpdata/en/fa/096ce5543b11d1898e0000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_46c/helpdata/en/fa/096ce5543b11d1898e0000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 08:17:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178153#M1198754</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T08:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178154#M1198755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can schedule the jobs in a chain through sm37 where jobs will be run one after the other only on successful completion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 08:33:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178154#M1198755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T08:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178155#M1198756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Easiest way is to create only one job with multiple steps : JOB_OPEN, SUBMIT, SUBMIT, .... JOB_CLOSE, then each report will execute after the previous one, any error/abend message will break the job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else you may condition each job to start with the end of the previous one. (fill parameter PRED_JOBCOUNT in JOB_CLOSE with the JOBCOUNT returned by the JOB_OPEN of the previous submitted Job)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more complex requirement or information look at [Programming with the Background Processing System (BC-CCM-BTC)|http://help.sap.com/erp2005_ehp_04/helpdata/EN/fa/096c53543b11d1898e0000e8322d00/frameset.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 08:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178155#M1198756</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-02-19T08:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178156#M1198757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi raymond,&lt;/P&gt;&lt;P&gt;i have done as u said .i have passed parameters like previous jobname,jobcount to job_close function module.but it was giving dump saying that invalid job start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please guide me.&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 08:45:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178156#M1198757</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T08:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178157#M1198758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have a look&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_46c/helpdata/en/fa/096ce5543b11d1898e0000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_46c/helpdata/en/fa/096ce5543b11d1898e0000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shashi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 08:53:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178157#M1198758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T08:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178158#M1198759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to schedule the first job some seconds in future as it must not be active when scheduling the following jobs. job must be in a status scheduled or released. Look at [Sample Program: Start-Time Window with JOB_CLOSE|http://help.sap.com/saphelp_40b/helpdata/EN/fa/096d8e543b11d1898e0000e8322d00/content.htm] (check parameters used)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also in [Sample Program: Wait for Predecessor Job with JOB_CLOSE|http://help.sap.com/saphelp_40b/helpdata/EN/fa/096db5543b11d1898e0000e8322d00/content.htm] look for a job predecessor scheduling. (check parameters used)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 08:59:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178158#M1198759</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-02-19T08:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178159#M1198760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;as per the procedure i have done evry thing still i am getting runtime error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_FILENAMES INTO TS_FILENAMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF SY-TABIX = 1.&lt;/P&gt;&lt;P&gt;    JOBNAME = TS_FILENAMES-ZZFNAME.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'JOB_OPEN'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        JOBNAME  = JOBNAME&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        JOBCOUNT = JOBCOUNT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SUBMIT  program  WITH P_FILE1 = TS_FILENAMES-ZZFNAME VIA JOB JOBNAME NUMBER JOBCOUNT AND RETURN.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'JOB_CLOSE'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        JOBCOUNT  = JOBCOUNT&lt;/P&gt;&lt;P&gt;        JOBNAME   = JOBNAME&lt;/P&gt;&lt;P&gt;        STRTIMMED = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    JOBNAME2 = TS_FILENAMES-ZZFNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'JOB_OPEN'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        JOBNAME  = JOBNAME2&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        JOBCOUNT = JOBCOUNT2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SUBMIT  program  WITH P_FILE1 = TS_FILENAMES-ZZFNAME VIA JOB JOBNAME2 NUMBER JOBCOUNT2 AND RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    .&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'JOB_CLOSE'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        JOBCOUNT          = JOBCOUNT2&lt;/P&gt;&lt;P&gt;        JOBNAME           = JOBNAME2&lt;/P&gt;&lt;P&gt;        PREDJOB_CHECKSTAT = 'X'&lt;/P&gt;&lt;P&gt;        PRED_JOBCOUNT     = JOBCOUNT&lt;/P&gt;&lt;P&gt;        PRED_JOBNAME      = JOBNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    JOBCOUNT = JOBCOUNT2.&lt;/P&gt;&lt;P&gt;    JOBNAME = JOBNAME2.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 09:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178159#M1198760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T09:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178160#M1198761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I went through this extensively in this thread, maybe you can find valuable information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="942939"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 09:03:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178160#M1198761</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-02-19T09:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178161#M1198762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thomas,&lt;/P&gt;&lt;P&gt;thanks for ur reply.but i already did as u sais.u can check my code.but still i am getting error as invalid ob start.&lt;/P&gt;&lt;P&gt;first job is execution successfully.but when cursor comes to second job_close function it was giving dump error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 09:09:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178161#M1198762</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T09:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178162#M1198763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should call JOB_CLOSE for the first job &lt;EM&gt;after&lt;/EM&gt; calling JOB_CLOSE for the second job, otherwise the first job is already active when you try to set it as predecessor -&amp;gt; error.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 09:13:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178162#M1198763</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-02-19T09:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178163#M1198764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_filenames INTO ts_filenames.

  CALL FUNCTION 'JOB_OPEN'
       EXPORTING
            jobname  = jobname
       IMPORTING
            jobcount = jobcount.

  SUBMIT program
    WITH p_file1 = ts_filenames-zzfname
    VIA JOB jobname NUMBER jobcount
    AND RETURN.

  IF sy-tabix EQ 1.
    CLEAR: pred_jobcount,
           pred_jobname.
    GET TIME.
    IF sy-uzeit LT '235950'.
      sdlsstrttm = sy-uzeit + 10.
      sdlstrtdt = sy-datum.
    ELSE.
      sdlsstrttm = '000010'.
      sdlstrtdt = sy-datum + 1.
    ENDIF.
  ELSE.
    sdlsstrttm = '      '. " no_time from LBTCHTOP
    sdlstrtdt = '        '. " no_date from LBTCHTOP
  ENDIF.

  CALL FUNCTION 'JOB_CLOSE'
       EXPORTING
            jobcount             = jobcount
            jobname              = jobname
            predjob_checkstat    = ' '
            pred_jobcount        = pred_jobcount
            pred_jobname         = pred_jobname
            sdlstrtdt            = sdlstrtdt
            sdlstrttm            = sdlstrttm
       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.

  pred_jobcount = jobcount.
  pred_jobname = jobname.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I removed the checkstat, cause if you want to check the status you only have to submit one job with multiple steps. (Put JOB_OPEN and JOB_CLOSE out of the loop)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; CALL FUNCTION 'JOB_OPEN'
     EXPORTING
          jobname  = jobname
     IMPORTING
          jobcount = jobcount.

LOOP AT it_filenames INTO ts_filenames.

  SUBMIT program
    WITH p_file1 = ts_filenames-zzfname
    VIA JOB jobname NUMBER jobcount
    AND RETURN.

ENDLOOP.

CALL FUNCTION 'JOB_CLOSE'
     EXPORTING
          jobcount  = jobcount
          jobname   = jobname
          strtimmed = 'X'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 09:28:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178163#M1198764</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-02-19T09:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: background job - programs all running at the same time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178164#M1198765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks u thomas.&lt;/P&gt;&lt;P&gt;my problem was solved with ur solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 10:45:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job-programs-all-running-at-the-same-time/m-p/5178164#M1198765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T10:45:48Z</dc:date>
    </item>
  </channel>
</rss>

