Application Development 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: 

Get Full Marks!!!

naveen_inuganti2
Active Contributor
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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

former_member784222
Active Participant
0 Kudos

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.