Can i write like this ... will it work
Can i write like below...
loop at itab. --- populate bapi tables with itab data. --- Call BAPI endloop. Call bapi_transaction_commit.
in the above example, lets take if i am changing sales orders, after i change 10 sales orders, can i commit all of them at one shot or for every bapi call do i need to commit it.
You have to call BAPI_TRANSACTION_COMMIT after each BAPI call, i.e. inside the LOOP in your case. If its outside the loop it will only update the database with the last call.