on 06-01-2007 6:45 AM
im doin a script for sales order.
my question is that is i enter a range for SO..
i need the subtotals for every SO on that page and also at the last page i want the total of all the subtotals..
i ve got through for the subtotals..but getting total and subtotal simultaneously on the last page is a problem.
n till nw its page1 format..
do i ve to include page2 format or any other soution??
Hi,
If u wantto display the grand total in the last page, u can handle that in the driver program.
AT LAST .
sum the field into var1.
Endat .
In the scripttext editor of first page of footer window,
&var1&
It will no way effect ur Subtotal at the end of ur page.
Revert back if any issues,
Reward with points if helpful.
Regards,
Naveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi rashmi,
If the above code doesn't work means, use upto subtotal part. That means after at last u can remove and do in the above loop itself.see the below one.
loop at itab.
v_qty =v_qty+ itab-qty.
call function 'WRITE_form' for element 'TABLE_ROW'.
at end of vbeln.
read table itab index sy-tabix.
sum.
call function 'WRITE_form' for element 'TABLE_SUBTOTAL'.
endloop.
in the variable v_qty u will have total value.
reward if helpful
Thanks,
Suma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rashmi,
I missed one statement. plz use the below code.
loop at itab.
call function 'write_form'
exporting
element = 'TABLE_ROW'
function = 'SET'
type = 'BODY'
window = 'MAIN'
<b>at end of vbeln</b>
read itab index sy-tabix.
sum.
call function 'write_form'
exporting
element = 'TABLE_SUBTOTAL'
f unction = 'SET'
type = 'BODY'
window = 'MAIN'
endat.
<b> at last.</b>
read table itab index sy-tabix.
sum.
call function 'write_form'
exporting
element = 'TABLE_TOTAL'
function = 'SET'
type = 'BODY'
window = 'MAIN'
endat.
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi rashmi,
If u are able to do subtotals in script means u can find total in driver program and save it in variable . use that variable in sapscript last page. plz check suppose this code is useful.
loop at itab.
call function 'write_form'
exporting
element = <b>'TABLE_ROW'</b>
function = 'SET'
type = 'BODY'
window = 'MAIN'
read itab index sy-tabix.
sum.
call function 'write_form'
exporting
element = <b>'TABLE_SUBTOTAL'</b>
function = 'SET'
type = 'BODY'
window = 'MAIN'
endat.
<b>at last</b>.
read table itab index sy-tabix.
sum.
call function 'write_form'
exporting
element = <b>'TABLE_TOTAL'</b>
function = 'SET'
type = 'BODY'
window = 'MAIN'
endat.
endloop.
IIn sap script under 'TABLE_ROW' element write all coloumns.
under 'TABLE_SUBTOTAL' itab-qty
under 'TABLE_TOTAL' itab-qty
I am not sure. but it may work plz once test it.
reward if helpful.
Thanks,
Suma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Look at the below link
http://www.sap-img.com/sapscripts/sapscript-how-to-calculate-totals-and-subtotals.htm
Regards
Sudheer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.