‎2008 Apr 29 8:25 AM
Hi....
I am having a quantity field in my table control display....
now my reqirement is to get sum of that field in the last row of the table control......
like....
f1: f2: f3: f4: f5:
aaa abc 003 x 1000
bbb def 004 x 2000
ccc ghi 098 x 3000
ddd - 321 x 4000
-
10000
now iam have been completed coding part of above table control exept that '9000'....
How to get it and where i need to write code for that?
Thank you,
Naveen Inuganti.
Edited by: Naveen Inuganti on Apr 29, 2008 1:02 PM
‎2008 Apr 29 9:18 AM
Hi,
create one field in screen at above/below of table control. write code in PBO module for do sum and stroe into field.
Ex.
write this code in PBO module and add wa_total field in screen.don't try to add record in itab. because That method is something tough.
clear wa_total.
loop at itab.
wa_total = wa_total + itab-f5.
endloop.
reward, if useful.
L.Velu
‎2008 Apr 29 9:18 AM
Hi,
create one field in screen at above/below of table control. write code in PBO module for do sum and stroe into field.
Ex.
write this code in PBO module and add wa_total field in screen.don't try to add record in itab. because That method is something tough.
clear wa_total.
loop at itab.
wa_total = wa_total + itab-f5.
endloop.
reward, if useful.
L.Velu
‎2008 Apr 29 9:25 AM
HI,
Before coming into the screen, you need to loop at internal table. At last sum. This command will sum all the values. Insert this sum as last row of the table control.
From here everytime the screen is refreshed with new values, you need to delete the last row of the internal table, do a sum at last and insert new record at last.
Thanks and regards,
S. Chandra Mouli.