07-02-2011 7:09 AM
Hello Experts,
I have an issue. I have developed the report to calculate the power per ton. It is PM module.
Input is : DATE & Measuring Point.
Output required is : For a particular date , What is the power consumed per ton.
Its is calculated by the formula Power consumed per day / Production.
I have multiple entries for production ( because different material are used ) per date and a single entery for power (because power is taken as total power consumed per day)
Hence im getting the output as
For example:
date power production power/ton
01.03.2011 5000 100 50.00
01.03.2011 5000 50 100.00
01.03.2011 5000 25 200.00
01.03.2011 5000 75 66.66
The desired result is
date power production power/ton
01.03.2011 5000 250 20.00
I need to sum the production field.
How can I achieve this ?
Please help.
07-02-2011 7:43 AM
Hello
Rotate the loop and use event so on change just clear the variable based date condition .
take 2 temp variable for summation
clearing the total and moving value on permanent variable means modifying the itab.
loop at .
*Clear
***************************
on change <datefield>.
modify itab from wa transporting <field name> .
clear <total field>.
endon.
*****************************
*Total
**************************
t_prd = t_prd + production..
t_power = t_power + power .
**************************
endloop.
07-02-2011 7:43 AM
Hello
Rotate the loop and use event so on change just clear the variable based date condition .
take 2 temp variable for summation
clearing the total and moving value on permanent variable means modifying the itab.
loop at .
*Clear
***************************
on change <datefield>.
modify itab from wa transporting <field name> .
clear <total field>.
endon.
*****************************
*Total
**************************
t_prd = t_prd + production..
t_power = t_power + power .
**************************
endloop.
07-02-2011 8:02 AM
Thank you so much for your reply.
Can u pls be more clear and specific on
"Rotate the loop and use event so on change just clear the variable based date condition ."
Im a fresher and still learning.
Thanks in advance.