<?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: Commit Work Delay in Background Job submission in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809774#M1468776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it's better you put a second report (many a new one with coding for second part of your logic).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put this report as second step of your job (you can just do another SUBMIT before the close_job).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, when the background program finish the next step is automatic your logic (at same LUW).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another advantage is that your first program should ends, releasing the LUW.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a good pratice to do not wait for another LUW that you can't guarantee their execution in time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Fernando Da Ró&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Apr 2010 14:24:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-26T14:24:27Z</dc:date>
    <item>
      <title>Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809767#M1468769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there, I have a function module which gets called by a Service interface proxy. Inside the function module, I have a Job_open, submit to standard sap report (VI04 transaction equivalent) and Job_close. The standard SAP report creates SCD header and saves it. But when the job finishes and Job_close gets called, the data is still not commited to database (I poll to check if there is a record by reference number). I have wait up to 4 seconds and it works most of the time but misses sometimes. Is adding more delay only the solution or is there anything else I can do to quickly force the commit to database so my polling results in success. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 17:59:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809767#M1468769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-19T17:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809768#M1468770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using the statement : COMMIT WORK AND WAIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should take care of the commit to the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anusha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 05:53:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809768#M1468770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-20T05:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809769#M1468771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. My submit job runs in background with a scheduler ID. So it's a different LUW than my calling program. I will try AND WAIT addition and I'll double check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 14:11:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809769#M1468771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-20T14:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809770#M1468772</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;&amp;gt; submit to standard sap report (VI04 transaction equivalent) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it might be related to asynchronous update.&lt;/P&gt;&lt;P&gt;check if the standard report offers the possibility for a synchronous update... (documentatin, selection screen fields, ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 14:36:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809770#M1468772</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2010-04-20T14:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809771#M1468773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Commit work and wait. will definitely work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 16:23:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809771#M1468773</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T16:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809772#M1468774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you call a program in background using job_open, submit and job_close. They will start to run only after JOB_CLOSE, and at this time even if you choose run IMMEDIATELY, there's no guarantee that you job will in fact run in X seconds, because they will only run when there's a background slot WP free.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why are you calling a job if you need the result into your program ? Why not just call SUBMIT AND RETURN  w/o job ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you really need run something after the job, you probably need a second step on your job with the rest of code or do not use jobs for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Fernando Da Ró&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 16:51:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809772#M1468774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T16:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809773#M1468775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a good question as why I want to trigger it in background mode! The reason is cause the program behaves differently when run online or submit mode versus background mode. In online mode it requires a user interaction for certain thing to happen but in background it executes the whole step without any user interaction. This is vital for my functionality. I will give Commit work and wait a try but since it's going to be 2 different LUWs I'm not too sure that it would work. I can only add more wait and hope the polling works, at this time. Thanks for suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 14:16:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809773#M1468775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T14:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809774#M1468776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it's better you put a second report (many a new one with coding for second part of your logic).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put this report as second step of your job (you can just do another SUBMIT before the close_job).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, when the background program finish the next step is automatic your logic (at same LUW).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another advantage is that your first program should ends, releasing the LUW.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a good pratice to do not wait for another LUW that you can't guarantee their execution in time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Fernando Da Ró&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 14:24:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809774#M1468776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T14:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809775#M1468777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree, I'll have to do something jazzy here. I was actually thinking of encapsulating the whole thing as a background task function module and wait till all the locks are released (I think locks are causing the issue because it happens only in first iteration). I do have a fallback system where I'll let the process handle it rather than putting too much programming (if 200 documents are created in one day I don't want to have 400 job completion steps as for any reason something fails, it's a hassle)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also for who suggested Commit work and wait, I tried it and as suspected, it didn't work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 15:39:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809775#M1468777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T15:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809776#M1468778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved this on my own. I called the routine which creates the document I need in using Perform in Program technique. I have a couple of hardcoded parameter right now but they are mostly system sort of commands.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 16:34:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809776#M1468778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T16:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809777#M1468779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Solved this on my own. I called the routine which creates the document I need in using Perform in Program technique. I have a couple of hardcoded parameter right now but they are mostly system sort of commands.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was exactly what I asked for you:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Why not just call SUBMIT AND RETURN w/o job ?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To put that to work you just needed to comment JOBOPEN, JOB CLOSE and the VIA JOB instruction on SUBMIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Fernando Da Ró&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 16:51:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809777#M1468779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T16:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809778#M1468780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't use SUBMIT and RETURN. As soon as the report behind the transaction gets SUBMITted it calls it one foreground, which requires user interaction as I explained. What I've done though is to dissect the functionality of the standard transaction and put the required subroutines in order I need and called Perform in Program. Now the logic is standalone and has no resemblance to standard program. SUBMIT and RETURN doesn't produce the same output. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 19:25:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809778#M1468780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T19:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Commit Work Delay in Background Job submission</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809779#M1468781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you your feedback. &lt;/P&gt;&lt;P&gt;Understood your points and totally agree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Fernando Da Ró&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 19:27:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/commit-work-delay-in-background-job-submission/m-p/6809779#M1468781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T19:27:03Z</dc:date>
    </item>
  </channel>
</rss>

