Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_TRANSACTION_COMMIT not working

Former Member
0 Likes
4,938

hello experts,

i am creating a sales inquiry through BAPI_INQUIRY_CREATEFROMDATA. after creating the inquiry, i selected from VBAK table again to get information on the created inquiry. this is unsuccessful when i executed the program because it doesn't get the details of the newly created inquiry. (but during debugging mode it is successful.) i already used BAPI_TRANSACTION_COMMIT after the BAPI_INQUIRY_CREATEFROMDATA.

do you know of any alternative on BAPI_TRANSACTION_COMMIT ?

it seems that the database table doesn't get updated immediately.

help me out on this, gurus.

thank you.

8 REPLIES 8
Read only

Former Member
2,708

Mark WAIT = 'X' while calling BAPI_TRANSACTION_COMMIT.

Read only

0 Likes
2,708

i have marked 'X' on the WAIT already but still it's not working...:-(

Read only

0 Likes
2,708

Hi,

Just write Commit Work after calling the BAPI. Does the BAPI return an error or is it succesful?

Nayan

Read only

Former Member
0 Likes
2,708

put some delay between two BAPIs like.

wait up to 2 seconds.

Edited by: Rajinikanth G on Jun 25, 2008 12:55 PM

Read only

Former Member
0 Likes
2,708

Hi,

While using BAPI_TRANSACTION_COMMIT

wait = 'X' for Asynchronous Call

wait = space for Synchronous Call

Warm Regards

R Adarsh

Read only

Former Member
0 Likes
2,708

Hi,

May be your BAPI is returning a error.

So check for same.

IF return-type NA 'EA'.

call function 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = RETURN.

Hope this works out.

plz reward if useful.

thanks,

dhanashri.

Read only

Maciej_DomagaBa
Contributor
0 Likes
2,708

Setting WAIT='X' in BAPI_TRANSACTON_COMMIT should be enough.

But if it is not then it may suggest that asynchronous "commit work" is triggered before your call to BAPI_TRANSACTON_COMMIT (commit in update task). Maybe some part of your code executed between call to BAPI_ALM_CONF_CREATE and BAPI_TRANSACTON_COMMIT performs commit ? If this is the case then calling BAPI_TRANSACTON_COMMIT with WAIT='X' has no effect because the commit process is already in progress and apprently it's a commit submited without "and wait" clause (commit in update task) - and your code performing "select ... from VBAK" is executed before this commit finishes.

So you should ensure that no "commit work" is called between BAPI_ALM_CONF_CREATE and BAPI_TRANSACTON_COMMIT.

(You can also check if fm BAPI_ALM_CONF_CREATE does not call commit itself - there have been such errors in BAPIs - see for example note 831583 "BAPI_SHIPMENT_CREATE performs COMMIT WORK")

If nothing of the above hepls then you can always use an ABAP staement in your program:

set update task local

This way you tell the system not to perform any commits (submitted by your program) in update task but instead: in the same process - the updade code and code of your program will execute in the same OS process - so your code will have to wait until the code performing update finishes. That should solve your problem for sure, regardless of any commits between BAPI_ALM_CONF_CREATE and BAPI_TRANSACTON_COMMIT and whether BAPI_ALM_CONF_CREATE triggers commit itself or not.

Check also this thread: [;

good luck

Read only

Former Member
0 Likes
2,708

hello all,

i have found a solution for this. i used the FM 'ENQUE_SLEEP' after the BAPI_TRANSACTION_COMMIT... and fortunately, it works now...

anyways, i appreciate all of your quick response.

thank you..

-march-