Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

PM Reports: Need to find the sum of a particular field in the output.

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

2 REPLIES 2

Former Member
0 Kudos

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.

0 Kudos

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.