on 04-26-2009 10:58 AM
Hi experts,
Iam developing a smartform for invoice. My requirement is to print sub total for multiple items for one invocie. The subtotal needs to be printed for the field (netwr) to print the net price of particular item.
For example in MAIN window, there are 5 items in first page and 4 items in second page for a invoice. I want the total of 5 items to be printed in the first page at the bottom. Then, this total of the first page needs to be carried forward in 2nd page at the top. In the second page, the 4 items needs to be added to the total of first page and grand total needs to be displayed.
Please give me the detail code to develop the above requirement ASAP.
The answers will not be rewarded.
Thanks,
Chintu.
Edited by: Rob Burbank on Apr 27, 2009 2:10 PM
Actually my page contains NETWR and also some other fields( KWERT etc). So i need to get the total of all these fields. In this case, if I specify NETWR in calculations tab, it only gives me the NETWR value. So please give me the solution to get sub total for all the fields.
Thanks
Chintu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
in the wiki specified below ,it had explained in very better way of your requirment.
[https://wiki.sdn.sap.com/wiki/display/ABAP/SUBTOTALINSAP+SMARTFORMS]
Regards
Hareesh Menon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check SDN Wiki. There is an example meeting your requirement.
You can simply follow that.
Thanks,
Babu Kilari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can code like this.
in global definitions -> zsum like vbrp-netwr.( initial value = 0 )
create table in main window.
at end of main area in table create program lines & write code for subtotal.
zsum = zsum + itab-netwr. (itab is your internal table which you are looping inside table )
Dont forrget to clear this variable at last.
now display this variable in table footer.
Imp thing to note that to display subtotal at each page -> double click on footer.
There are two check boxes -> at page break & at end of table.
Check both the boxes.
Also to display first page sub total at top of next page just display that variable at appropriate place.
In condition tab of that text element check the box "Not on First Page " .
Hope this will help to solve your problem.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> The answers will be rewarded.
First of all, u r not supposed to write that, its against the rules,
coming to ur requirement,
use a table node to display line items and in the calculations tab use a variable to keep on totaling, at the end in the footer display this variable as subtotal, also store it in another variable to keep its track on next page also,
dont forget to use page protection to get consistent results
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.