<?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 Function module JOB_CLOSE throwing exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388190#M1404296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a batch job which has 2 steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Step 1 uses job_open, job_submit and job_close and &lt;EM&gt;immediately&lt;/EM&gt; schedules batch job A/P_ACCOUNTS which in turn creates batch input sessions A/P_ACCOUNTS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Step 2 Processes A/P_ACCOUNTS sessions created yesterday or today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In few cases, job_close is throwing exception job_close_failed. I believe that error is coming due to non availability of work processes. Job A/P_Accounts is defined as a class C batch job. There is a check in the FM job_close which does the following check:&lt;/P&gt;&lt;P&gt; - if the class of a batch job is B or C, it calculates the number of free work processes. If there are no work processes available then JOB_CLOSE throws JOB_CLOSE_FAILED exception.  &lt;/P&gt;&lt;P&gt; - If the class is u2018Au2019, it skips this check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have an option of changing the class of batch job to A but there are some system critical jobs that are running as class A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code, JOB_CLOSE has been called for scheduling the job A/P_ACCOUNTS with parameter start immediately. Can anyone please let me know what will happen if function JOB_CLOSE is not called with start immediately option? Will the batch job A/P_ACCOUNTS wait till the time work processes are available?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, can anything else be done to solve the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddharth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Dec 2009 10:39:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-11T10:39:28Z</dc:date>
    <item>
      <title>Function module JOB_CLOSE throwing exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388190#M1404296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a batch job which has 2 steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Step 1 uses job_open, job_submit and job_close and &lt;EM&gt;immediately&lt;/EM&gt; schedules batch job A/P_ACCOUNTS which in turn creates batch input sessions A/P_ACCOUNTS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Step 2 Processes A/P_ACCOUNTS sessions created yesterday or today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In few cases, job_close is throwing exception job_close_failed. I believe that error is coming due to non availability of work processes. Job A/P_Accounts is defined as a class C batch job. There is a check in the FM job_close which does the following check:&lt;/P&gt;&lt;P&gt; - if the class of a batch job is B or C, it calculates the number of free work processes. If there are no work processes available then JOB_CLOSE throws JOB_CLOSE_FAILED exception.  &lt;/P&gt;&lt;P&gt; - If the class is u2018Au2019, it skips this check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have an option of changing the class of batch job to A but there are some system critical jobs that are running as class A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code, JOB_CLOSE has been called for scheduling the job A/P_ACCOUNTS with parameter start immediately. Can anyone please let me know what will happen if function JOB_CLOSE is not called with start immediately option? Will the batch job A/P_ACCOUNTS wait till the time work processes are available?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, can anything else be done to solve the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddharth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 10:39:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388190#M1404296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T10:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Function module JOB_CLOSE throwing exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388191#M1404297</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;PRE&gt;&lt;CODE&gt;let me know what will happen if function JOB_CLOSE is not called with start immediately option?&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So? In which option you want to call the job?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose u can insert a delayed, for example to schedule the job in order to start on certain hours: in this case if any backgroud process is available, the job'll wait for the first available PID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 10:47:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388191#M1404297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T10:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Function module JOB_CLOSE throwing exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388192#M1404298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.. ven i faced this issue..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i tried to set the time and date for the job to start..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but didn't worked out..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i made it start immediately..and it gets into Queue and once the proceessor is free..it starts running..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think setting it to start immediately will not effect the system...system will queue the job&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Yadesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 10:52:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388192#M1404298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T10:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Function module JOB_CLOSE throwing exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388193#M1404299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yadesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as i understood while debugging it, if there are no processes available it throws the dump immediately. This is based on a condition statement. If not available raise the exception. It does not go into any queue. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct me if i am wrong and what i can make out from your post is calling the job without (start immediately) option will not change the way JOB_CLOSE works?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddharth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 11:07:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388193#M1404299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T11:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Function module JOB_CLOSE throwing exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388194#M1404300</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 is my experience with job_close..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i was working in zprograms then i was able to scedule it any time i wanted..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in my standard program when i tried it didn't worked....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i have to use that option of starting it immediately..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then it is working fine..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now if i schedule 5 jobs... one after another..&lt;/P&gt;&lt;P&gt;its get queued up...and once the processor is free...its working..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my code of job close&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             = job_count&lt;/P&gt;&lt;P&gt;      jobname              = job_name&lt;/P&gt;&lt;P&gt;      strtimmed            = yes " yes = 'X'&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      job_was_released     = job_released&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      cant_start_immediate = 1&lt;/P&gt;&lt;P&gt;      invalid_startdate    = 2&lt;/P&gt;&lt;P&gt;      jobname_missing      = 3&lt;/P&gt;&lt;P&gt;      job_close_failed     = 4&lt;/P&gt;&lt;P&gt;      job_nosteps          = 5&lt;/P&gt;&lt;P&gt;      job_notex            = 6&lt;/P&gt;&lt;P&gt;      lock_failed          = 7&lt;/P&gt;&lt;P&gt;      invalid_target       = 8&lt;/P&gt;&lt;P&gt;      OTHERS               = 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Yadesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 11:15:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388194#M1404300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T11:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Function module JOB_CLOSE throwing exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388195#M1404301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The intent behind my question was to know if we do not schedule the job immediately, will the batch job A/P_ACCOUNTS wait for the availability of a work process (if we schedule it to some other time). As i can see through debugging if we try to release the job immediately and if it does not find any work process, the job throws the exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we schedule the job say after 5 hours than how batch will be released or if at that time also there are no other free processes available then how long can it wait in the queue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddharth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2009 02:03:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388195#M1404301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-14T02:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Function module JOB_CLOSE throwing exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388196#M1404302</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;As you said that you are submitting the job with the class 'C' because there are some mission critical jobs with Class 'A' and 'B'&lt;/P&gt;&lt;P&gt;Put the code TRY CATCH Block.&lt;/P&gt;&lt;P&gt;So while trying if an exception occurs, because resource is not available handle the exception and re submit the job with an higher class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you and correct me if I am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranjith Nambiar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2009 03:19:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388196#M1404302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-14T03:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Function module JOB_CLOSE throwing exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388197#M1404303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Issue resolved.. changed class to A..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2010 17:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-job-close-throwing-exception/m-p/6388197#M1404303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-09T17:19:15Z</dc:date>
    </item>
  </channel>
</rss>

