‎2008 Jan 16 5:46 AM
I HAVE DIFFERENT AMOUNTS IN A INTERNAL TABLE. I WANT TO GET THE SUM OF THOSE AMOUNTS.
HOW TO DO THAT
‎2008 Jan 16 5:50 AM
Hi,
use contol break statement.
LOOP AT ITAB.
AT LAST.
SUM.
ENDAT.
ENDLOOP.
Regards,
Nagaraj
‎2008 Jan 16 5:52 AM
Hi Das,
Try This one.
data: total type netpr.
data: begin of itab occurs 0,
vbeln like vbap-vbeln,
netpr like vbap-netpr,
end of itab.
For example we have to sum the netpr filed follow this logic ok.
loop at itab.
total = total + itab-netpr.
endloop.
write 😕 total.
Reward points if helpful.
Kiran Kumar.G.A
‎2008 Jan 16 5:52 AM
Hi,
Try using SUM to find the total . To know how to use it try the below link :
‎2008 Jan 16 5:53 AM
hi,
use the code.
data: lv_sum type <amount datatype>.(currency)
Loop at itab into wa.
---
---.
lv_sum = lv_sum + wa-amount.
endloop.