Hi Arora,
SUM in control break command will hold sum of the variable you will mention with control command. If you want to add sum of two variables then add totals of each SUM varaible.
Check the below code.
V_FIELD1_SUM V_FIELD2_SUM V_TOTAL_SUM Loop at it_table. At LAST amount. sum. WRITE IT_TABLE-amount TO V_FIELD1_SUM. endat. At LAST field2. sum. WRITE IT_TABLE-field2 TO V_FIELD2_SUM. endat. endloop. V_TOTAL_SUM = V_FIELD1_SUM + V_FIELD2_SUM. WRITE:/ V_FIELD1_SUM,V_FIELD2_SUM,V_TOTAL_SUM
Thanks,
Vinay
sum1 = 0.
sum2 = 0.
Loop at it_table.
sum1 = sum1 + field1.
sum2 = sum2 +field2.
endloop.
write : sum1.
write : sum2.
Hope it works...Reward points if useful....
Regards
Rudra
Add a comment