‎2006 Aug 23 6:40 PM
‎2006 Aug 23 6:47 PM
‎2006 Aug 23 6:47 PM
‎2006 Aug 24 4:37 AM
Hi,
You can thread the sfsy-page field.
This field give the current page number.
You can, for example add a code block with :
if sfsy-page ne w_sfsy_init.
clear w_sum.
endif.
I Think you can also count your number of line in a page. ( works only if different pages have the same line number )
go through this link:
‎2006 Aug 24 5:24 AM
Hi,
I think there is no automated way of putting subtotals in smartform.
What you should do is add a new edit mask after the items loop, and have the totals prepared in advance in the print program of your smartform. Pass the totals to the form though another structure.
The other thing you could do, is add abap code in the items loop, summing data as you go in a separate global field defined in the smartform, and display the result in a separate structure after the loop.
Regards,
‎2008 Jun 30 4:03 AM
In the table, in which you are displaying the items,
1.Give the field name for which you want the sort criteria(based on which the subtotal is needed). Then click on the radio button u2018event on sort endu2019. ( For eg: you are looping the internal table it_sflight into wa_sflight which contains the fields carrid , connid and price. And you want to print the subtotal on the basis of connid. In the table, in the data tab give the sort criteria field as connid and click on event on sort end )
2.An event node will be created.
3.Create two table lines in the event node.
a.One for displaying the items
b.Other for displaying the subtotal.
4.Create program lines in the table and write the code as Subtotal = subtotal + wa_sflight-price.
5.Create a text in the subtotal tableline and drag the subtotal variable there.
6.After the subtotal variable is displayed, clear the variable subtotal.(Clear: subtotal in a program line)
Edited by: Shiny S Krishna on Jun 30, 2008 5:06 AM