‎2006 Dec 01 5:48 AM
hi!
can someone explain how I can add all the values in a column and write the result in another column?
thx,
Srikanth.
‎2006 Dec 01 6:37 AM
hi ,
20
30
40 90 "---> the sum is captured over here .just execute the code .
data: begin of itab occurs 0 ,
f1 type i ,
f2 type i,
end of itab.
data : sum type i.
data : cntr like sy-tabix.
itab-f1 = '20'.
append itab.
itab-f1 = '30'.
append itab.
itab-f1 = '40'.
append itab.
loop at itab.
sum = sum + itab-f1.
cntr = cntr + 1.
at last.
itab-f2 = sum.
clear sum.
modify itab index cntr transporting f2.
endat.
endloop.
loop at itab .
write:/ itab-f1,
itab-f2.
endloop.regards,
vijay
‎2006 Dec 01 6:37 AM
hi ,
20
30
40 90 "---> the sum is captured over here .just execute the code .
data: begin of itab occurs 0 ,
f1 type i ,
f2 type i,
end of itab.
data : sum type i.
data : cntr like sy-tabix.
itab-f1 = '20'.
append itab.
itab-f1 = '30'.
append itab.
itab-f1 = '40'.
append itab.
loop at itab.
sum = sum + itab-f1.
cntr = cntr + 1.
at last.
itab-f2 = sum.
clear sum.
modify itab index cntr transporting f2.
endat.
endloop.
loop at itab .
write:/ itab-f1,
itab-f2.
endloop.regards,
vijay
‎2006 Dec 04 1:57 AM