‎2008 Jul 01 6:55 AM
Hi,
In my smart form i calculate the total excise duty of each line item at the end of loop. I specified it in the calculation tab of main table in my form.
But it is not calculating the total at end of loop.
But in the debugger I could see the the total is getting calculated. But it dosent get displayed in my form output.
This is happening with only 1 record, i.e when I enter the billing doc no. as 11100855. Other wise it works fine.
I find that sequence of execution for this record is different from the rest.
Thanks.
Sai.
‎2008 Jul 01 8:08 AM
Hi Sai,
Whenever caluculate the subtotals in calculation TAB
try to print the subtotals in footer of the main table.
Thanks & regards
Bhupal.
‎2008 Jul 01 7:02 AM
hi sai,
check whether there is any table entries exist for that doc no.
srinivas
‎2008 Jul 01 7:08 AM
Hi Srinivas,
I can see the records in the table entries, even in debugging mode i can see the sum is getting calculated but sequence of execution is different from other records.
Thanks.
Sai.
‎2008 Jul 01 7:32 AM
hi sai
where you are displaying the total,i mean in footer of table or in separate text after table.(please let me know u r displaying page totals or subtotals)
srinivas.
‎2008 Jul 01 7:36 AM
Hi Srinivas,
I'm displaying text in separate text after table.
These are totals of that page.
Thanks,
Sai.
‎2008 Jul 01 7:45 AM
Hi,
When I create a watch point of global variable total, which is my field for page total, for this record, i.e billing doc no 11100855, watch point is reached twice, but this should not happen, because i'm calculation the sub total in the smart from table but I have coded the variable total which is the sum of all the sub totals out side the smart from table.
Thanks,
Sai.
‎2008 Jul 01 8:02 AM
hi sai ,
follow the steps to create subtotals.it may be helpfull.
1>before your item table create a loop .
and get your header table data from table to work area in data tab of this loop.
ex: t_vbrk into w_vbrk.
2>and go to calculations tab of this loop.
operation: total.
fieldname: w_vbrp-netwr.
target fieldname: subtot.
time : afterloop.
3>under this loop create program lines a,in that clear subtot.
4>create table under this loop.Declare item table loop in the data tab of this table ex: t_vbrp into w_vbrp and specify where condition vbeln = w_vbrk-vbeln in the same data tab.
5>dont decalre anything in calculations tab of this table.
6>after the table create text and call subtot here.
and in global definations. subtot type netwr.
i hope it might be helpfull.
rewards if helpfull.
srinivas
‎2008 Jul 01 8:03 AM
Hi,
Also for this perticaular record the sum of subtotals which I'm calculating in the smart form table is returning 0, but after reaching global variable total which is after the smart form table, again the control reaches the sum in smart form table.
I dont understand why this is the case.
Thanks,
Sai.
‎2008 Jul 01 7:32 AM
Hi Sai,
OPERATION : total
FIELD name: wa_final-total
Targetfieldname : l_total
time: after loop
l_total as varible declared in global definition
Can you please assign in calucilation TAB like that after you will check it
and also find out table entries there or not for doc no
Rewards if helpful
Thanks & regards
BHUPAL.
Edited by: bhupal reddy on Jul 1, 2008 8:33 AM
‎2008 Jul 01 7:35 AM
Sai,
Are you declering the your total variable in Output parameter?
Amit.
‎2008 Jul 01 8:08 AM
Hi Sai,
Whenever caluculate the subtotals in calculation TAB
try to print the subtotals in footer of the main table.
Thanks & regards
Bhupal.
‎2008 Jul 01 8:21 AM
hi sai ,
just make sure u r calling subtotal in text after the table ,but inside the header loop.
srinivas.
‎2008 Jul 01 10:09 AM
Thanks Srinavas for your help, now the problem is solved.
Regards,
Sai.