2020 Apr 08 9:15 AM
Hi
I am experimenting with parallel processing.
I have called multiple FMs as tasks, and they trigger their own closure method once completed.(ON END OF TASK)
Each method will be updating a single, global internal table based on outputs from each task/FM.
What if multiple methods are triggered at same time and attempt to update the internal table all at once. For updating DB tables we can make use of lock objects.
How do we control and regulate concurrent access to internal tables? Is such a control required?
How can we implement semaphores/mutex within abap methods?
Note: I have been searching for a while. All answers seem to point to basis related queries or other programming languages. May be i am missing the correct keyword. Any inputs will be very helpful.
2020 Apr 08 9:44 AM
Please explain why you need a common internal table.
No need to control concurrent access if you don't use a common internal table. You should make each task independent from the others, work with local variables, not global, and you assemble the final data in the "closure method" (ON END OF TASK).
2020 Apr 08 10:21 AM
Hi Sandra,
The variables inside each of the closure methods are local to them.
Depending on the task, different methods are called at the end. One task will be returning EVER table entries, another will be returning ERDK entries and another will be returning BUT000 entries. And each method has code to derive BP based on what data is returned.
I need to consolidate BPs related to each of the above into a single internal table. For this purpose i was going to use a global internal table. And in this case don't we need a lock mechanism, in case multiple methods try to access the internal table at the same time?
Thanks
Joshua.
2020 Apr 08 2:12 PM
You say "I need to consolidate BPs related to each of the above". Why don't you do it in the method "closure method" (ON END OF TASK)?