All mentioned above code is good. but if value 0 and non 0 is Ok to your next process.
Don`t need sort the three itab.
loop gt_itab2 into gwa_itab2.
collect gwa_itab2 into gt_itab1.
endloop.
loop gt_itab3 into gwa_itab3.
collect gwa_itab3 into gt_itab1.
endloop.
Next process, just judge the value.
if gwa_itab1-value eq 0.
...
elseif.
...
endif.
Regards,
Archer