11-27-2008 2:10 PM
in the classical report,i want to output the display of consolidated view in the common display of the output.
here in consolidated view,i want to sum all the fields aganist one customer.
So need to sort with the customer.
please guide me with the lines of code and the possible placement,
it would b great if you can.
11-27-2008 2:17 PM
Hi Tanisha ,
In Reports , we have wonderfull concept call control break events ,
make use of them , AT NEW - ENDAT,
AT FIRST - ENDAT,
AT LAST - ENDAT.
and for summation of any values use keyword SUM in AT LAST - ENDAT event .
Regards,
Aby.
Please close this thread as soon as your problem is solved.
11-27-2008 2:26 PM
Hello
loop at itab.
at end of kunnr.
sum.
write: 'Total on customer:', itab-dmbtr, """etc
endat.
endloop.
11-27-2008 2:33 PM
Hi,
Make sure that kunnr should be the very first field of your internal table.
Sort the Internal table based on kunnr.
loop at itab into wa.
at end of kunnr.
sum.
Write:/ 'Total value for this Customer is ' wa-f1.
endat.
endloop.
11-27-2008 2:37 PM
check sample code.
DATA : itab TYPE TABLE OF ekpo WITH HEADER LINE.
SELECT * FROM ekpo UP TO 20 ROWS
INTO itab.
APPEND itab.
ENDSELECT.
sort itab.
LOOP AT itab.
WRITE : / itab-ebeln, 20 itab-ebelp, 40 itab-menge.
AT END OF ebeln.
SUM.
ULINE.
WRITE : /40 itab-menge.
uline.
ENDAT.
ENDLOOP.