‎2007 Sep 19 5:35 PM
Which is better performance wise?
I'm doing a mass change of final confirmation using BAPI_ALM_CONF_CREATE. I have more than 100 records for processing.
Should I do a commit work for each record processed?
LOOP AT ITAB.
CALL FUNCTION 'BAPI_ALM_CONF_CREATE'
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ENDLOOP.
or
Should I do the commit work after processing all the records?
LOOP AT ITAB.
CALL FUNCTION 'BAPI_ALM_CONF_CREATE'
ENDLOOP.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Thanks in advance!
‎2007 Sep 19 5:45 PM
You might get better performance by doing it at the end, but you might also end up with inconsistent data. You should do a commit after each LUW.
(You might not get any performance improvement by putting it at the end either. The COMMIT still has to do the same amount of actual work, less some overhead.)
Rob
‎2007 Sep 19 5:55 PM
hi JB,
I would do it for each record separately. In case of doing it in one go, could lead to problems, if the update is asynchronous. On the other hand, if one reocrd is wrong, than you loose all changes.
ec
‎2007 Sep 19 6:34 PM
But is it ok do the COMMIT for each order or is it better to do it for each order and operation?
‎2007 Sep 19 7:24 PM