I am stuck at a problem that I want to solve with REDUCE syntax.
I have this this internal table

I need to sum the values of the column "quantity" and update column called "Totals quantity"
And the same thing with column price in column "Total Price". This is for each Purchase order.
I have this code right now
Loop at it_numpos Into Data(ls_numpos).
lv_valort = lv_valort + ls_numpos-netpr. " Purchase Order Total Price
lv_cantt = lv_cantt + ls_numpos-menge. " Purchase Total Quantity
At end of ebeln.
ls_numpos-zmenge3 = lv_cantt.
ls_numpos-znetpr6 = lv_valort.
Modify it_numpos From ls_numpos Transporting zmenge3 znetpr6 Where ebeln = ls_numpos-ebeln.
Clear: lv_cantt, ls_numpos, lv_valort.
Endat.
EndLoop.
It is possible to transform this code to abap new syntax?