2011 Jul 12 1:52 PM
Hi
can anyone give me some idea how to use collect statement with index
here in the below syntax i want to use collect instead of insert.
INSERT WA_ALVDISPLAY INTO IT_ALVDISPLAY index 3 .
thanks.
vivekk
Hi
can anyone give me some idea how to use collect statement with index
here in the below syntax i want to use collect instead of insert.
INSERT WA_ALVDISPLAY INTO IT_ALVDISPLAY index 3 .
thanks.
vivekk
2011 Jul 12 2:27 PM
I don't see that this makes any sense. Collecting and inserting are two different things.
Rob
2011 Jul 12 2:42 PM
Hi,
why would you want to use the collect with an index? Do you know what a collect
is suppossed to do and how it works? If so, for what purpose would you need an
index addition?
Kind regards,
Hermann
Hi
>
> can anyone give me some idea how to use collect statement with index
> here in the below syntax i want to use collect instead of insert.
>
> INSERT WA_ALVDISPLAY INTO IT_ALVDISPLAY index 3 .
>
> thanks.
> vivekk
2011 Jul 13 5:48 AM
hi
my scenario is like this
i need an yearly report of a examination held in a school based on month,each month they need report for girls and boys separately
the output format should be like this
month:marks( boys) marks( girls )
so i have created 3 internal tables suppose itab ,itab1,itab2.
itab1-month1
itab1-boy_sub1
itab1-boy_sub2
itab2-month2
itab2-girl_sub1
itab2-girl_sub2
itab -month1
itab -boy_sub1
itab -boy_sub2
itab -girl_sub1
itab -girl_sub2
first i am looping in itab1 and using COLLECT statement i am inserting data to itab (bez in a month more than one exam can happen)
i got boys mark in itab,then i need to put girls mark on the same row based on month
based on particular index i need to insert data, moreover i need to use COLLECT statement for getting the total of particular month
thanks
vivek
2011 Jul 13 7:37 AM
hello Vivek,
I believe your desired result will be available using COLLECT without worrying about the order of the rows.
Since Collect will only add up the values if month is same and insert a new entry if month is different (because you have only numeric fields other than month).
Loop at itab1.
move-corresponding itab1 to itab.
collect itab.
endloop.
Loop at itab2.
move-corresponding itab2 to itab.
collect itab.
endloop
Please ask if you have any query.
regards,
Diwakar
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |