‎2007 Dec 18 6:08 AM
Hello Gurus,
I've 12 fields in my internal table and i want sum the 6th field with respect to 1st ,5th and 9th field.
How to sum it up.Please do advice me .
Thanks in advance.
ashok...
‎2007 Dec 18 6:20 AM
use:
data zsum type i.
loop at itab.
itab-field6 = itab-field1 + itab-field5 + itab-field9.
modify itab index sy-tabix transporting field6.
endloop.
plz reward points if dis helps
Edited by: abapuser on Dec 18, 2007 7:20 AM
‎2007 Dec 18 6:23 AM
Hi Ashok,
Is it cumpulsory to sum the 6th field wtih respect to 1st, 5th and 9th? what are the fields 1st,5th and 9th?
You can easily sum by using 1st field.
Ex there is internal table itab.
1st field is matnr. 6th field is quantity (menge)
sort itab by matnr.
loop at itab.
at end of matnr.
sum.
Write: itab-matnr, itab-menge.
endat.
endloop.
Revert back if anything .....
<b>please reward if useful </b>
Regards,
sunil kairam.
‎2007 Dec 18 6:58 AM
Hi Ashok,
You can easily sum by using 1st field.
sort itab by 1st field 5th field 9th field.
loop at itab.
at end of 1st field.
sum.
Write: itab-Ist field, itab-6th field.
endat.
endloop.
Revert back if anything .....
please reward if useful
Regards
Manoj Kumar
‎2007 Dec 18 7:04 AM
Hi,
You can do as below :
Loop at itab.
itab-field6 = itab-field1 + itab-field5 + itab-field9.
modify itab.
clear itab.
endloop.
Thanks,
Sriram Ponna.
‎2007 Dec 18 7:05 AM
Hi,
You can do as below :
Loop at itab.
itab-field6 = itab-field1 + itab-field5 + itab-field9.
modify itab.
clear itab.
endloop.
Thanks,
Sriram Ponna.