Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

TOTAL

Former Member
0 Likes
440

I HAVE DIFFERENT AMOUNTS IN A INTERNAL TABLE. I WANT TO GET THE SUM OF THOSE AMOUNTS.

HOW TO DO THAT

4 REPLIES 4
Read only

former_member404244
Active Contributor
0 Likes
422

Hi,

use contol break statement.

LOOP AT ITAB.

AT LAST.

SUM.

ENDAT.

ENDLOOP.

Regards,

Nagaraj

Read only

Former Member
0 Likes
422

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

Read only

Former Member
0 Likes
422

Hi,

Try using SUM to find the total . To know how to use it try the below link :

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/sum.htm

Read only

Former Member
0 Likes
422

hi,

use the code.

data: lv_sum type <amount datatype>.(currency)

Loop at itab into wa.

---

---.

lv_sum = lv_sum + wa-amount.

endloop.