‎2011 Sep 23 4:52 AM
Hi Gurus,
Lets say I am uploading fixed assets data using BAPI_FIXEDASSET_CREATE from excel file. There are many assets to be uploaded.
I use this as the logic.
Loop at table ( table contains all the fixed assets data )
Logic follows here to populate data for one fixed asset ***
Call BAPI_FIXEDASSET_CREATE
if error message.
BAPI_TRANSACTION_ROLLBACK.
add error message to output report.
elseif success message.
add success message to output report.
endif.
endloop.
call bapi_transaction_commit with wait = X.
*****************************************************************************************
My queries:
1. Can BAPI_TRANSACTION_COMMIT commit all the successful created assets simultaneously?
2. Is it advisable to perform BAPI_TRANSACTION_COMMIT after each successfull BAPI_FIXEDASSET_CREATE or the above logic would work fine? If any record fails during commit I need to know which one failed.
3. Will performing BAPI_TRANSACTION_COMMIT after each successfull BAPI_FIXEDASSET_CREATE slow down the process when compared to commiting all successful records simultaneously
‎2011 Sep 23 5:25 AM
Hi,
If any record fails during commit I need to know which one failed
In this case you have to commit each bapi call and make use of the return parameter of BAPI_TRANSACTION_COMMIT, for this you have to pass wait = X becasue when sy-subrc is 4 after a synchronous call then it implies error.
In your case you can do this,
Call your bapi with required data, check if the call is successfull and then can call commit with wait.
Commit work - Asynchronous
Commit work with wait - Synchronous
All your questions can be cleared by yourself by reading SAP help documentation on Logical unit of Work.
Regards
Kesav
‎2011 Sep 23 5:25 AM
Hi,
If any record fails during commit I need to know which one failed
In this case you have to commit each bapi call and make use of the return parameter of BAPI_TRANSACTION_COMMIT, for this you have to pass wait = X becasue when sy-subrc is 4 after a synchronous call then it implies error.
In your case you can do this,
Call your bapi with required data, check if the call is successfull and then can call commit with wait.
Commit work - Asynchronous
Commit work with wait - Synchronous
All your questions can be cleared by yourself by reading SAP help documentation on Logical unit of Work.
Regards
Kesav