<?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_TRANSACTION_COMMIT doesn't save fast enough? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803524#M1124629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You all for your responses.&lt;/P&gt;&lt;P&gt;Finally - suggested "wait up to..." did the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Netiher Commit work nor commit work and wait worked for me (tried that earlier, also they are used in &lt;/P&gt;&lt;P&gt;bapi_commit_transaction).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also took all the other suggestions into considerations and maybe I will have opportunity to use them in future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Mateusz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mateusz K on Dec 7, 2008 10:32 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Dec 2008 21:31:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-07T21:31:23Z</dc:date>
    <item>
      <title>BAPI_TRANSACTION_COMMIT doesn't save fast enough?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803518#M1124623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using BAPIs to create order confirmation, and if good movements failed for this confirmation I want it to be cancelled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
** get data and fill in missing fields
CALL FUNCTION 'BAPI_PRODORDCONF_GET_TT_PROP'
[...]

** create confirmation
CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'
  EXPORTING
    post_wrong_entries = '0'  "do not save confirmation on error
    testrun = ' '
  IMPORTING
    RETURN = t_return_err
  TABLES
    timetickets = t_timetickets
    goodsmovements = t_goodsmovements
    link_conf_goodsmov = t_link_conf_goodsmov
    detail_return = t_return_details.

** check if there was an error 
IF t_return_err-TYPE = 'E' OR t_return_err-TYPE = 'A'. "if 'E'error or 'A'bort
** rollback changes
  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
  RAISE CONFIRMATION_FAILED.
ENDIF.

** check if there was an error regarding data provided
IF t_return_details-TYPE = 'E' OR t_return_details-TYPE = 'A'. "if 'E'error or 'A'bort
  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
  RAISE CONFIRMATION_FAILED.
ENDIF.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    WAIT = 'X'.

confirmation = t_return_details-conf_no.
confirmationcounter = t_return_details-conf_cnt.

CALL FUNCTION 'BAPI_PRODORDCONF_GETDETAIL'
  EXPORTING
    CONFIRMATION = confirmation
    CONFIRMATIONCOUNTER = confirmationcounter
  IMPORTING
    RETURN = t_return_err
    CONF_DETAIL = t_conf_detail
  TABLES
    GOODSMOVEMENTS = t_goodsmovements_correct
    FAILEDGMOVES = t_failedgmoves.


IF t_return_err-TYPE = 'E' OR t_return_err-TYPE = 'A'. "if 'E'error or 'A'bort
  RAISE CONFIRMATION_FAILED.
ENDIF.

** Check if goods movement was successful, and if not cancel the confirmation
IF t_failedgmoves IS NOT INITIAL.

** Cancel the confirmation that failed
  CALL FUNCTION 'BAPI_PRODORDCONF_CANCEL'
    EXPORTING
      CONFIRMATION              = confirmation
      CONFIRMATIONCOUNTER       = confirmationcounter
   IMPORTING
      RETURN                    = t_return_err
      LOCKED                    = locked
      CREATED_CONF_NO           = confirmation_created
      CREATED_CONF_COUNT        = confirmationcounter_created.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT = 'X'.

[...]
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And my problem is as follows:&lt;/P&gt;&lt;P&gt;If I just run this transaction as it is, I am given following error from &lt;STRONG&gt;BAPI_PRODORDCONF_CANCEL&lt;/STRONG&gt; function:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Future change records for background processing exist for order XXXXX&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and confirmation_created and confirmationcounter_created variables are zeros (0).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I debug this code and set breakpoint at the line&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_PRODORDCONF_CANCEL'&lt;/P&gt;&lt;P&gt;(and then run it further) then the error doesn't appear and confirmation_created and confirmationcounter_created variables are given correct values and everything executes correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems like the first BAPI_TRANSACTION_COMMIT doesn't have enough time to execute, but it is assigned WAIT flag, so this should not be the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could You suggest any solution/explanation for this weird behaviour?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Mateusz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 23:16:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803518#M1124623</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-04T23:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT doesn't save fast enough?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803519#M1124624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use WAIT UPTO XXXX Seconds .. after bapi commit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mohan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 02:36:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803519#M1124624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T02:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT doesn't save fast enough?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803520#M1124625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can also write  COMMIT WORK AND WAIT only &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;insteadof&lt;/STRONG&gt;  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 06:49:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803520#M1124625</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T06:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT doesn't save fast enough?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803521#M1124626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Call the FM in UPDATE TASK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 06:52:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803521#M1124626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T06:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT doesn't save fast enough?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803522#M1124627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After BAPI_TRANSACTION_COMMIT use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wait 5 seconds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 06:54:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803522#M1124627</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T06:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT doesn't save fast enough?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803523#M1124628</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;I Have done the same with the modulepool program for the confirmation of order and the goods movement for that order....for that i used the following Bapi's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For production order confirmation    CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_HDR'&lt;/P&gt;&lt;P&gt;after this       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and  for goods movement         CALL FUNCTION 'BAPI_GOODSMVT_CREATE'&lt;/P&gt;&lt;P&gt; after this      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for the production order cancel....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          CALL FUNCTION 'BAPI_PRODORDCONF_CANCEL'&lt;/P&gt;&lt;P&gt;Everything went fine for me by following this sequence...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you also to solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rohan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 12:22:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803523#M1124628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-05T12:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_TRANSACTION_COMMIT doesn't save fast enough?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803524#M1124629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You all for your responses.&lt;/P&gt;&lt;P&gt;Finally - suggested "wait up to..." did the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Netiher Commit work nor commit work and wait worked for me (tried that earlier, also they are used in &lt;/P&gt;&lt;P&gt;bapi_commit_transaction).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also took all the other suggestions into considerations and maybe I will have opportunity to use them in future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Mateusz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mateusz K on Dec 7, 2008 10:32 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Dec 2008 21:31:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-transaction-commit-doesn-t-save-fast-enough/m-p/4803524#M1124629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-07T21:31:23Z</dc:date>
    </item>
  </channel>
</rss>

