2013 Nov 25 9:10 AM
Dear all
I have calculated subtotal for every page using calculations
subtotal for the first page coming correctly,, but from the second page its adding the value of last row of the internal table rather first row value of second page ,,its omitting first row value of every page ,, its happening at each and every page..
Regards
2013 Nov 25 9:54 AM
Please attach a screen shot of your calculations and at what time the values are being calculated and displayed
2013 Nov 25 10:22 AM
2013 Nov 25 11:14 AM
Hi KArthik
In which node you are printing sub total ? Please make sure you have marked at end of page check box. Plus clear the value of sum after it gets printed
Nabheet
2013 Nov 25 11:49 AM
Hi-
Follow below steps to display Sub-totals in smart forms:
-> Create a new variable in your form which is of type 'I' say gv_sub_total.
-> In your Table -> Main Area -> Create a Program Line under your text cell with below code:
gv_sub_total = gv_sub_total + wa_itab-val2. (Don't forget to give this variable in I/P and O/P parameters).
-> On your table Footer-> Output Options -> Select check box at Page Break.
-> Inside your Footer create a text to display Sub-Totals value.
-> Just underneath the text create a Program Line and write below code to clear sub total variable:
CLEAR gv_sub_total.
-> Now your sub-total value will be displayed whenever their is a page break in Smart Form nut what in case your page ends in middle say last page there sub total will be missing. Hence you have to create a template underneath the table with the text cell displaying gv_sub_total value with a condition gv_sub_total > 0.
This is working for me:
-Venkat
2013 Nov 25 11:53 AM
2013 Nov 27 6:41 AM
Dear venkat,
i have done as you said but problem is in the second page ther is one line item ,,but its value calculated in the first page itself .
page 1
10
10
5
subtotal = 30
page2
5
2013 Nov 27 6:51 AM
Could you please share your code which you have written for calculating sub-totals in program lines?
Also paste the screen shot of your footer expanding till your text cells.
-Venkat
2013 Nov 27 8:18 AM
IF it_final-shkzg = 'S'.
w_debit_sum = w_debit_sum + it_final-wrbtr.
ELSEIF it_final-shkzg = 'H'.
w_credit_sum = w_credit_sum + it_final-wrbtr1.
ENDIF.
2013 Nov 27 8:41 AM
Hi-
Please write below code under Main Window -> Table -> Main Area -> Text Cell -> Program Line.
IF it_final-shkzg = 'S'.
w_debit_sum = w_debit_sum + it_final-wrbtr.
ELSEIF it_final-shkzg = 'H'.
w_credit_sum = w_credit_sum + it_final-wrbtr1.
ENDIF.
-Venkat