03-16-2012 2:44 PM
Hello Gurus,
I am trying to do paralle processing in ABAP. I am having few issues. I am calling a custom function module in a loop where I pass the invocie number and I want back the amount calcualted (based on some custom logic) in custom function module.
After the parallel processing is finsihed, I want all the amounts for different invocies to be written on output screen. But the issue is, the screen-output does not show all amounts for all invocies passed. Sometimes it shows the amount for last invocie multiple times, sometimes not.
Please help.
Regards,
TG
03-19-2012 6:41 AM
Hi Tushar,
Just to add to Thomas, in the Function Call 'Z_CALCULATE_AMOUNT', verify the return codes, clear all the work areas before calculating, and add another field 'vbeln' with the amount field to ensure which value is getting repeated.
Ideally, clearing of work areas and addition of 'IF' conditions with return codes will solve your problem. Hope this helps.
Regards,
Pranav.
03-16-2012 3:00 PM
Two remarks at quick glance, you should check and react to return codes <> 0 from the aRFC call and repeat the call e.g. in case of a resource failure (could mean that no processes are available), and also you should maintain global counters for number of processes started and finished, and only start your final output once #finished = #started (remember that these are asynchronous calls). Use the WAIT UNTIL statement for this, see ABAP documentation and please search for available sample code.
Thomas
03-19-2012 6:41 AM
Hi Tushar,
Just to add to Thomas, in the Function Call 'Z_CALCULATE_AMOUNT', verify the return codes, clear all the work areas before calculating, and add another field 'vbeln' with the amount field to ensure which value is getting repeated.
Ideally, clearing of work areas and addition of 'IF' conditions with return codes will solve your problem. Hope this helps.
Regards,
Pranav.