‎2007 Jul 26 12:52 PM
Hi all,
I have data like this.
Type Quater1 Quater2
Tax Refund 1000 2000
Tax Refund 2000 3000
Tax Refund 2000 2000
Tax Refund 3000 1000
Tax Refund 5000. 1000
but in my final output I want to display
type Quater1 Quater2
Tax Refund 13000 9000.
How can i do that in ALV.
regards,
Ajay reddy
‎2007 Jul 26 12:54 PM
Hello Ajay,
<b>Use Collect itab instead of Append Itab</b>
Vasanth
‎2007 Jul 26 12:54 PM
Hello Ajay,
<b>Use Collect itab instead of Append Itab</b>
Vasanth
‎2007 Jul 26 12:55 PM
Hi, you can collect tha dates.
If you collect you display the date how you want.
‎2007 Jul 26 12:56 PM
Hi
put the data in ITAB
sort itab by first field
use at end of ..
do SUM.
and display the data.
sort itab by taxtype.
loop at itab.
at end of taxtype.
sum.
write:/ itab-taxtype, itab-amnt1, itab-amnt2.
endat.
endloop.
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Jul 26 12:56 PM
Use this code:
loop at itab1.
collect itab1 into itab2.
endloop.itab2 will have your desired output.
Please mark points if the solution was useful.
Regards,
Manoj
‎2007 Jul 26 12:57 PM
Hi Ajay,
If you want to display only the TOTAL lines, then you can loop into your internal table and COLLECT the date into another internal table. Pass that to the function module.
LOOP AT ITAB1 into LS_ITAB1
LS_ITAB2 = LS_ITAB1.
COLLECT LS_ITAB2 to IT_ITAB2.
ENDLOOP.
Pass ITAB2 to your function module for ALV Grid.
If you want to display line items as well as SUM then while building Field Catalog use the property DO_SUM = X and pass it to the Function module.
<b>Reward points for informatory answers.</b>
Best Regards,
Ram.