<?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: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355855#M1640642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your reference, go thru the help link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Synchronous and Asynchronous Updates:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/e5/de86e735cd11d3acb00000e83539c3/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/e5/de86e735cd11d3acb00000e83539c3/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LUW`s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I can tell you another way to check this, execute the BAPI thru SE37, and unless you execute them in sequence with COMMIT WORK FM you will see what I said. i.e. PR created but will get rolled back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sure this will clear most of your doubts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Reetesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Nov 2011 21:38:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-11T21:38:34Z</dc:date>
    <item>
      <title>BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355844#M1640631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran into an issue and wanted to get your opinions about what might be happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my original code that did not work correctly using COMMIT WORK AND WAIT. After the select statement, lv_count was zero even though there were PR items that had been created. I'm thinking that the database update was not complete, but why would that be?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    CALL FUNCTION 'BAPI_REQUISITION_CREATE'
      IMPORTING
        number            = lv_number
      TABLES
        requisition_items = gt_reqitem
        return            = gt_return.

*   Purchase requisition has been created
    IF lv_number IS NOT INITIAL.
      COMMIT WORK AND WAIT.

*     Get number of items in PR
      SELECT COUNT( DISTINCT bnfpo ) INTO lv_count
        FROM eban
        WHERE banfn = lv_number.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my corrected code that works. I removed the AND WAIT from the commit statement and added a separate wait statement. I now get the correct number of PR items that were created.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    CALL FUNCTION 'BAPI_REQUISITION_CREATE'
      IMPORTING
        number            = lv_number
      TABLES
        requisition_items = gt_reqitem
        return            = gt_return.

*   Purchase requisition has been created
    IF lv_number IS NOT INITIAL.
      COMMIT WORK.
      WAIT UP TO 1 SECONDS.

*     Get number of items in PR
      SELECT COUNT( DISTINCT bnfpo ) INTO lv_count
        FROM eban
        WHERE banfn = lv_number.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Brenda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 16:41:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355844#M1640631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T16:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355845#M1640632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brenda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Insert this statement just before the BAPI call:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET UPDATE TASK LOCAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And remove your WAIT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this will solve your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 17:31:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355845#M1640632</guid>
      <dc:creator>arseni_gallardo</dc:creator>
      <dc:date>2011-11-11T17:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355846#M1640633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Commit Work and Wait. is used for synchronous update, since this scenario is of Asynchronous update hence your correct code is working. I am pretty sure even if you remove WAIT UP TO 1 sec. it will work. All it requires is COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. To commit work after calling a BAPI, you should use,FM  "BAPI_TRANSACTION_COMMIT" instead of any other statement(s).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you find this useful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Reetesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Reetesh Tiwary on Nov 11, 2011 6:53 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 17:45:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355846#M1640633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T17:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355847#M1640634</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;When you use COMMIT WORK AND WAIT then the program processing after COMMIT WORK will not continue until the update work process has executed the high-priority update function modules Sync updating.&lt;/P&gt;&lt;P&gt;Within an update function module started using COMMIT WORK, the execution of statements that lead to a database commit is not permitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead when you use COMMIT WORK and then WAIT FOR X DURATION.&lt;/P&gt;&lt;P&gt;The commit work part is: &lt;/P&gt;&lt;P&gt;The program does not wait until the update work process has executed it, this is called async updating. &lt;/P&gt;&lt;P&gt;The wait statement part is:&lt;/P&gt;&lt;P&gt;The statement WAIT causes a change in the work process. When ever you use a WAIT, a database commit is issued.&lt;/P&gt;&lt;P&gt;And also when this type of WAIT is used the time should be more than 1 sec minimum.&lt;/P&gt;&lt;P&gt;Because during this waiting process program roll in and roll out occurs. So if it is less than 1 sec then load increases on system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 17:51:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355847#M1640634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T17:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355848#M1640635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So this DATABASE COMMIT is the reason why  you getting it when you use WAIT statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 17:55:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355848#M1640635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T17:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355849#M1640636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran into an issue and wanted to get your opinions about what might be happening.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; This is my original code that did not work correctly using COMMIT WORK AND WAIT. After the select statement, lv_count was zero even though there were PR items that had been created. I'm thinking that the database update was not complete, but why would that be?&lt;/P&gt;&lt;P&gt;&amp;gt; Brenda&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple search in service market place returned the note 394058 and according to the note, the BAPI BAPI_REQUISITION_CREATE spares the burden of issuing a explicit commit in the application program as it triggers COMMIT on its own, if that is to be true, I suspect an application error might be the reason for the current behaviour, you may implement a double check by also querying the RETURN table of the BAPI to check for any application errors insteaad of just relying on 'NUMBER' exported...the note also says there are alternatives available to this BAPI as of release mySAPERP2005 you might be interested in those...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 20:35:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355849#M1640636</guid>
      <dc:creator>rajesh_paruchuru</dc:creator>
      <dc:date>2011-11-11T20:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355850#M1640637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your answer. In response to using the COMMIT statement, I originally did not have any type of COMMIT after the call to the bapi and I was getting lv_count = 0 each time. That's why I added the COMMIT AND WAIT. Then when I tested I found that sometimes lv_count was zero and sometimes it was the correct count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also checked the RETURN table in debugging and found that it only contains one message stating that the PR was created. When I check table EBAN, I find that this is true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm still puzzled as to why COMMIT WORK AND WAIT does not give correct results consistently whereas COMMIT followed by WAIT x SECONDS does work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brenda&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, we're on ECC 6.0 so the note does not apply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 20:46:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355850#M1640637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T20:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355851#M1640638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Reetesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to SAP note 809747 I am using COMMIT WORK correctly.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
The caller of BAPIs must complete the transaction at the end of a 
LUW and trigger the update.
- If you call a BAPI from outside the SAP system, use the Service 
BAPI BapiService.TransactionCommit or function module 
BAPI_TRANSACTION_COMMIT.
- If you call a BAPI in a program within a system, complete the 
transaction with the ABAP command 'commit work'.
If you want to test a BAPI in the test environment of the function 
library (transaction SE37), you need to define a test sequence 
which first executes the BAPI you want to test and then 
BAPI_TRANSACTION_COMMIT.
Note also that, with the asynchronous update, the data may not 
be available immediately even with a successful 'commit work'. 
Either wait a moment or use the 'WAIT' parameter with module 
BAPI_TRANSACTION_COMMIT. See also Note 192235.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there a reason why you suggested using BAPI_TRANSACTION_COMMIT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brenda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 21:01:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355851#M1640638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T21:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355852#M1640639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brenda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try what I suggested before (set update task local). It will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 21:17:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355852#M1640639</guid>
      <dc:creator>arseni_gallardo</dc:creator>
      <dc:date>2011-11-11T21:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355853#M1640640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you tell me how/why it will work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 21:18:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355853#M1640640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T21:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355854#M1640641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;See there are two types of LUW`s Database and SAP LUW`s. There can be lot of database LUW`s within a SAP LUW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP LUW work all or nothing principal, i.e. when you complete a transaction, all the data gets written in all the respective tables that gets used within a transaction (and that happens at the end with the help of COMMIT WORK) or nothing get written to the database and all the temporary updates (that was triggered by DB LUW) gets rolled back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in your case since this process requires Asynchronous update COMMIT WORK is working (in the case of WAIT UP TO  when there large # of update to take place so you need to give time, as stated in notes).&lt;/P&gt;&lt;P&gt; OR you can use standard COMMIT WORK Function Module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason why COMMIT WORK AND WAIT is not working because system does not know where to go what to do and when to come back hence actual COMMIT WORK never happens and yet you can see PR is generated but since commit is not happening all the DB LUW`s gets rolled back. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope after this clarification we are on same page. Let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Reetesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 21:31:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355854#M1640641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T21:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355855#M1640642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your reference, go thru the help link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Synchronous and Asynchronous Updates:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/e5/de86e735cd11d3acb00000e83539c3/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/e5/de86e735cd11d3acb00000e83539c3/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LUW`s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I can tell you another way to check this, execute the BAPI thru SE37, and unless you execute them in sequence with COMMIT WORK FM you will see what I said. i.e. PR created but will get rolled back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sure this will clear most of your doubts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Reetesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 21:38:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355855#M1640642</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T21:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355856#M1640643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you take a look (or debug) to the source code of the BAPI you will see several "CALL FUNCTION xxx IN UPDATE TASK".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what the documentation says about IN UPDATE TASK:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module is not executed immediately, but is scheduled for execution in a special work process (update work process). For this purpose, the name of the function module including the passed actual parameters is stored as a log record in the database table VBLOG. If the statement is executed during the update task, the addition IN UPDATE TASK is ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the statement SET UPDATE TASK LOCAL is executed before registration of an update function module in the current SAP LUW, registration takes place in the ABAP memory rather than on the database, and for the current work process&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A COMMIT WORK AND WAIT does not wait for the V2 tasks to finish and that's why you are experiencing problems. If you use the SET UPDATE TASK LOCAL &lt;STRONG&gt;before&lt;/STRONG&gt; the first call IN UPDATE TASK LOCAL then all the function modules will be executed in your same process, not in a parallel one, and so the updates will have finished right after the commit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's why I suggest you to do a SET UPDATE TASK LOCAL before calling the BAPI and get rid of the WAIT xx SECONDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Arseni Gallardo on Nov 11, 2011 10:53 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 21:46:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355856#M1640643</guid>
      <dc:creator>arseni_gallardo</dc:creator>
      <dc:date>2011-11-11T21:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355857#M1640644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brenda - I see that you are using two different userids in this thread. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that you will only be able to assign points and mark this as closed if you log on under the one you used to ask the question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the future, please use only one userid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 21:51:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355857#M1640644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T21:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355858#M1640645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See, the moot problem is not with or without LOCAL TASK that you might and might not use, idea is to understand the concept of Synchronous and Asynchronous update and what COMMIT WORK and COMMIT WORK AND WAIT does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Btw, SET UPDATE TASK LOCAL is more to prioritize the update. In update task the data gets written in VBLOG table where as in this the data gets written to ABAP memory. It uses the current WP rather than Update WP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you got my point!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reetesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 21:54:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355858#M1640645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-11T21:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355859#M1640646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Also, we're on ECC 6.0 so the note does not apply.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, I can see that the note says that it is valid for all releases subsequent to 4.0B, we are on ECC 6.0 and in the source code of the BAPI I can see the macros(macro_start, macro_end) responsible for issuing a COMMIT WORK statement, it would be great if you can confirm that by placing a break point in the FM TRANSACTION_END where the actual COMMIT WORK is executed, if the COMMIT WORK statement were infact to be executed within the BAPI then that would mean that the update is  asynchronous(COMMIT WORK WITH OUT WAIT) and you may have to WAIT in your application for the updates to get completed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This would also mean that the COMMIT WORK AND WAIT statement within your application marks the end of subsequent LUW started after the original COMMIT statement issued within the BAPI and has no significance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F1 help on SET UPDATE TASK LOCAL says that:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;This statement has no effect on low-priority update function modules.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; and I would be surprised if the update of EBAN would be carried out in a FM which is not registered as V1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To conclude, I tend to believe the asynchrous COMMIT within the BAPI is the reason for the current behaviour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  having said this I still believe that you can get rid of the WAIT statement by using SET UPDATE TASK LOCAL because the statement makes the subsequent update synchronous irrespective of the WAIT addition as described in the F1 help:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;The local update function performs a synchronous update according to the COMMIT WORK statement, independent of the addition AND WAIT.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;this means that the COMMIT currently executed within BAPI would behave as a COMMIT WORK AND WAIT statement&lt;/P&gt;&lt;P&gt;and EBAN bieng a critical update would definitely be updated as a priority update and you should be able to read the results back in your application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rajesh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rajesh Paruchuru on Nov 12, 2011 10:44 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 23:50:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355859#M1640646</guid>
      <dc:creator>rajesh_paruchuru</dc:creator>
      <dc:date>2011-11-11T23:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355860#M1640647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First of all i will recommend you to read about [Synchronous and Asynchronous update|http://help.sap.com/saphelp_nw04/helpdata/en/e5/de86e735cd11d3acb00000e83539c3/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a reason why you suggested using BAPI_TRANSACTION_COMMIT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes !! you can read the Wiki by Sandra [BAPI_TRANSACTION_COMMIT versus COMMIT WORK|http://wiki.sdn.sap.com/wiki/display/ABAP/BAPI_TRANSACTION_COMMIT&lt;EM&gt;versus&lt;/EM&gt;COMMIT+WORK]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in your case its not required because the function BUFFER_REFRESH_ALL and commit is called internally in the function TRANSACTION_END.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm still puzzled as to why COMMIT WORK AND WAIT does not give correct results consistently whereas COMMIT followed by WAIT x SECONDS does work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You comit work doesnt have any importance here because the transaction flow is already ended by the commit in bapi itself.&lt;/P&gt;&lt;P&gt;As its asynchronous &lt;STRONG&gt;WAIT UP TO 1 SECONDS&lt;/STRONG&gt; will just give you the time to get it reflected in the DB. Its not that the other works and this doesnt work &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your code you need not provide a commit because the bapi internally commits the transaction before you do it . Please note that the commit inside the bapi is asynchronous in nature. Remove &lt;STRONG&gt;COMMIT WORK &amp;amp;  WAIT UP TO 1 SECONDS&lt;/STRONG&gt; from your code and always check your return table for success and failure. You need not do a select from EBAN to confirm its updated or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please note that Commit work and wait(Synchronous)cannot be replaced with commit work and wait upto n seconds(Asynchronous)&lt;/STRONG&gt;  - Both are totally different ( Hope so this is what lead to your confusion )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kesav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 05:06:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355860#M1640647</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-11-14T05:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355861#M1640648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;I'm only aware of having 1 userid.&lt;/P&gt;&lt;P&gt;Brenda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 13:51:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355861#M1640648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-14T13:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355862#M1640649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="user" id="4278683"&gt;&lt;/SPAN&gt; - a new one under which this thread was started and &lt;SPAN __jive_macro_name="user" id="3509172"&gt;&lt;/SPAN&gt; under which you are now responding and has more questions and points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 14:25:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355862#M1640649</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-14T14:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_REQUISITION_CREATE Problem with COMMIT WORK AND WAIT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355863#M1640650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have no idea how that happened. I didn't create a new one. Can you combine the 2 into 1?&lt;/P&gt;&lt;P&gt;Brenda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 14:27:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-requisition-create-problem-with-commit-work-and-wait/m-p/8355863#M1640650</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-14T14:27:09Z</dc:date>
    </item>
  </channel>
</rss>

