Does SAP support database transations, what I am doing is getting the values from one Zdatabase table , and taking a value which holds the total, adding one to this , and placing the record in a differnt ztable, and then incrementing the 'total' value in the orginal; ztable , I obviously want to make sure the whole transaction occurs or nothing, I'm using insert , update in opensql.
You can achieve that by creating Lock objects through SE11. Create one lock object including these tables. Once you do that, the system will generate a ENQUEUE and a DEQUEUE function module. You need to call the ENQUEUE function module before making any updates to the table and then the DEQUEUE after making the updates. This ensures that your data is locked in one single transaction. Now coming to making all updates or no updates, you need to do the entire sequence in one single task. The sequence is
CALL ENQUEUE FUNCTION MODULE
DO THE UPDATES.
CALL DEQUEUE FUNCTION MODULE.