‎2006 Jun 23 7:46 AM
Hello,
Iam working with scripts,
I have to give totals for my line items.i have to write a code in my form painter.
See if there is one item then one total price value is displaying,if there is 2 or 3 means then also the total price values are coming,but the problem i need the code for summing of all the line items at the end.
if it is one value then the total has to come.
if the values are two means then also the total has to come for the two values. When ever the item nos. are increasing the total price values are also increasing. I need totals for this all the line items when ever it is increasing.
Pls send me the Pseudo code.
Urgent.
thank You.
‎2006 Jun 23 8:07 AM
Hi you can't write code in form painter you have to write in a print program.
Or you can call a form from the form editor.
For SUMMING, use SUM statement.
LOOP AT itab.
AT LAST.
SUM.
call your text element to write values.
ENDAT.
ENDLOOP.
Regards,
Wasim Ahmed
‎2006 Jun 23 10:53 AM
Hi Amit,
The Internal Table values will be given from the driver program only. So what you can do is calculate the total value in the program like.
loop at i_tab.
sum.
ws_value = i_tab-total.
endloop.
Now your entire value of all the line items will be in ws_value.
You can display this variable in your script. This variable will have the total value of all the line items in the internal table.
Reply back if you have any doubts.
Regards,
Tushar
‎2006 Jun 23 11:10 AM
HI,
loop at itab.
call the finction module (to display line items)
with Element ex: ELE1
at last.
sum.
call the finction module (to display line items total)
with Element ex: ELE2
endat.
endloop.
‎2006 Jun 23 11:14 AM
hi
You simply needs to add the statement sum in at-last. Here is the pseudo code.
loop at itab.
//to display line items
at last.
sum.
//Display line items total
endat.
endloop.
Hope this info is useful
Regards,
Richa
‎2006 Jun 23 11:18 AM
Hi,
I think that you put the sum value in loop.Please check your code once.
Cheers,
Bujji