12-27-2010 8:26 AM
Hi All,
I calling the FM BAPI_EQUI_CHANGE and then CALL FUNCTION 'BAPI_TRANSACTION_COMMIT 'EXPORTING wait = 'X'.
But it seems like in the production environment the commit does not happen immediately and happens only when I add a "wait upto one second" statement. I want to avoid the wait and also a bit confused on why the commit BAPI does not work quickly enough. PLease enlightenme on this.
Best REgards,
Shankar.
12-27-2010 9:11 AM
Hi Shanker,
If you don't wanna let your program wait till any long; then you can comment EXPORTING section out. Example can be as below --
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
RETURN =
.
Thanks.
Kumar Saurav.
12-27-2010 11:39 AM
01-04-2011 1:39 PM
Hi,
Commit work is used when you code directly in ABAP and make changes in the database and
want to commit the database.
BAPI_TRANSACTION_COMMIT is used when you make changes to the SAP database by calling
a BAPI from outside SAP and want to commit the database. When you use a BAPI, you can not
directly use commit work, instead you are allowed to use only BAPI_TRANSACTION_COMMIT.
01-07-2011 9:39 AM
Hi,
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
and COMMIT WORK AND WAIT are same. This will help you to do synchronous update(ie it will wait till update happens before going to the next step).
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' and COMMIT WORK are same. the differnce with the above is that this may not be synchronous.
Regards,
Sajith
01-07-2011 10:01 AM
BAPI_TRANSACTION_COMMIT executes
- a COMMIT WORK, so it starts update task, if WAIT specified, it waits until task are ended, and execute a database commit (native SQL commit on database server)
- a buffer refresh of the BAPI tools only not of the whole database on server...
There can nevertheless be some delay due to database server even if database commit is required it may take time and Abap don't wait at this step, so even a WAIT UP TO n SECONDS can fail ( So [it will happen|http://en.wikipedia.org/wiki/Murphy%27s_law]). If you want to actually be sure that database is updated, you must execute a SELECT from database[ BYPASSING BUFFER|http://help.sap.com/abapdocu_70/en/ABAPFROM_CLAUSE.htm#&ABAP_ADDITION_3@3@] in a DO/ENDDO loop to insure data is created/updated (Of course put a limit at the number of tries performed)
Regards,
Raymond
10-26-2011 3:51 PM
Hello Raymond,
Could you kindly explain little more your idea:
"There can nevertheless be some delay due to database server even if database commit is required it may take time and Abap don't wait at this step"
What it is meant by due to database server?==> Communication between application server and Data base servers. or it is data replication between the Buffer Pool and Physical data base?
If ever (for whatever the reason) the physical commit fails, what will be the result? From ABAP point of view, everything is okay and no thing will be reported to SM13 , SM21.
So where we can find error coming from such commit incidents?
Thanks in advance
Meher
Edited by: Rob Burbank on Oct 26, 2011 10:54 AM