‎2008 Jun 25 11:45 AM
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.
‎2008 Jun 25 11:48 AM
‎2008 Jun 25 11:53 AM
i have marked 'X' on the WAIT already but still it's not working...:-(
‎2008 Jun 25 11:59 AM
Hi,
Just write Commit Work after calling the BAPI. Does the BAPI return an error or is it succesful?
Nayan
‎2008 Jun 25 11:54 AM
put some delay between two BAPIs like.
wait up to 2 seconds.
Edited by: Rajinikanth G on Jun 25, 2008 12:55 PM
‎2008 Jun 25 12:00 PM
Hi,
While using BAPI_TRANSACTION_COMMIT
wait = 'X' for Asynchronous Call
wait = space for Synchronous Call
Warm Regards
R Adarsh
‎2008 Jun 25 12:18 PM
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.
‎2008 Jun 25 12:19 PM
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 localThis 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.
good luck
‎2008 Jun 25 2:18 PM
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-