2007 Dec 07 5:33 AM
hi all ,
i have some fields in write statement o/p like NETWR , MWSBP... and i want to
take total (Sum of all NETWR & MWSBP) net value at end of output coloum..
how can i do in write statement.??
exa : NETWR MWSBP
100.00 25.00
50.00 10.00
-
-
<b>SUM 150.00 35.00</b>
can anybody help me its urgent .
regards saurabh .
hi all ,
i have some fields in write statement o/p like NETWR , MWSBP... and i want to
take total (Sum of all NETWR & MWSBP) net value at end of output coloum..
how can i do in write statement.??
exa : NETWR MWSBP
100.00 25.00
50.00 10.00
-
-
<b>SUM 150.00 35.00</b>
can anybody help me its urgent .
regards saurabh .
2007 Dec 07 5:40 AM
Hi use SUM, inside the loop.
Loop at itab.
at end of vbeln.
sum.
endat.
endloop.
or
data: tot_netwr type netwr.
loop at itab.
tot_netwr = tot_netwr + itab-netwr.
endloop.
write : / tot_netwr.
2007 Dec 07 5:41 AM
Hi,
Use control statement
Loop at itab.
at last.
sum.
write 😕
endloop.
Reagrds,
Prashant
2007 Dec 07 5:42 AM
Hi,
I hopr the example code below will help you:
DATA: BEGIN OF LUGGAGE,
AVERAGE TYPE P DECIMALS 2,
SUM TYPE P DECIMALS 2,
END OF LUGGAGE.
SELECT AVG( LUGGWEIGHT ) AS AVERAGE SUM( LUGGWEIGHT ) AS SUM
INTO CORRESPONDING FIELDS OF LUGGAGE
FROM SBOOK.
WRITE: / 'Average:', LUGGAGE-AVERAGE,
/ 'Sum :', LUGGAGE-SUM.
Please award points if found useful.
Cheers,
Chandra Sekhar.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |