<?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: Wait up to ... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-up-to/m-p/1765080#M330912</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, there is no sense in waiting when you are doing an explicit commit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOu can make a select statement on the master table of the batch data inside an indefinite loop.&lt;/P&gt;&lt;P&gt;If it gives a sy-subrc = 0., then exit that loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after the bapi calls:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;select single * from mchb where &amp;lt;condition&amp;gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2006 10:30:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-06T10:30:40Z</dc:date>
    <item>
      <title>Wait up to ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-up-to/m-p/1765078#M330910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am creating a batch using a BAPI and immediately creating characteristics with a value for that batch. The problem is the batch sucessfully getting created but the characteristic value is not updated. If i go in debug mode, i see  that my program is absolutely fine and working well. In debug mode its updating the characteristic value too. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i used WAIT UP TO 4 SECONDS after each BAPI. Now characteristic value is also updated. But the problem is when my server is slow, the wait time is not sufficient and my program is failing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My doubt is, i am using BAPI_TRANSACTION_COMMIT then why should i explicitly write a Wait statement. Is there any permanent solution for this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peice of my code is attached below for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_BATCH_CREATE'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          material           = l_material&lt;/P&gt;&lt;P&gt;          plant              = afvgd-werks&lt;/P&gt;&lt;P&gt;          batchcontrolfields = lw_batchcontrolfields&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          batch              = l_newbatch&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          return             = li_return_createbatch.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          wait = 'X'.&lt;/P&gt;&lt;P&gt;      WAIT UP TO 4 SECONDS.&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'BAPI_OBJCL_CREATE'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          objectkeynew   = l_material_char_create&lt;/P&gt;&lt;P&gt;          objecttablenew = lc_objecttable&lt;/P&gt;&lt;P&gt;          classnumnew    = l_classnum&lt;/P&gt;&lt;P&gt;          classtypenew   = lc_classtype&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          allocvaluesnum = li_allocvaluesnum_create&lt;/P&gt;&lt;P&gt;          return         = li_return_create.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          wait = 'X'.&lt;/P&gt;&lt;P&gt;      WAIT UP TO 4 SECONDS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:25:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-up-to/m-p/1765078#M330910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Wait up to ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-up-to/m-p/1765079#M330911</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;Try using   SET UPDATE TASK LOCAL. before each BAPI Call.&lt;/P&gt;&lt;P&gt;For more detail do F1 on SET and check SET UPDATE TASK LOCAL. option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:29:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-up-to/m-p/1765079#M330911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Wait up to ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-up-to/m-p/1765080#M330912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, there is no sense in waiting when you are doing an explicit commit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOu can make a select statement on the master table of the batch data inside an indefinite loop.&lt;/P&gt;&lt;P&gt;If it gives a sy-subrc = 0., then exit that loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after the bapi calls:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;select single * from mchb where &amp;lt;condition&amp;gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:30:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-up-to/m-p/1765080#M330912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Wait up to ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wait-up-to/m-p/1765081#M330913</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;You can increase your wait time to 15 seconds. however, when executed in background there will not be any problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;sksingh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 10:32:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wait-up-to/m-p/1765081#M330913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T10:32:33Z</dc:date>
    </item>
  </channel>
</rss>

