2009 Jun 10 10:03 AM
What is a collect statement? How is it different from append?
2009 Jun 10 10:06 AM
Varsha, Search in SDN before posting such a question...
Moreover you could have also used F1 help...
2009 Jun 10 10:28 AM
Hi Varsha,
Collect statement collect/adds the records based on a key field.
For Eg:
Itab:
F1 F2.
A 10
A 20
B 30
B 40
Collect statement will add the values of 10 and 20 since the Key field is A for both the entry.
Append will append/add a record at the end of existing records.
Thanks.
Mohanraj.N
2009 Jun 10 10:35 AM
I hope this will clear your idea about the difference between Collect and Append....
**********************************************************************************************
APPEND :
IT IS USED TO GET THE RECORD FROM THE INTERNAL TABLE HEADER TO THE BODY AREA
IT ALLOWS DUPLICATION
COLLECT:
IT IS USED TO A GET A RECORD FROM HEADER TO THE BODY AREA BUT IT WILL NOT ALLOW ANY DUPLICATION EXCEPT IF THERE IS ANY NUMERIC FIELS IT ADDS THAT FIELDS DATA BUT NOT AS A NEW RECORD
OR
If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry.
**********************************************************************************************
Regards,
Mandeep.
2009 Jun 10 10:44 AM
hi,
Append : creates the new entry in the internal table irrespective of (already) entry with the same key fields.
Collect : If an entry with the same key already exists, the collect statement does not append a new line, but adds the contents of the numeric fields in the work area in the existing entry.
2009 Jun 10 10:46 AM
Hi Varsha,
Chk these links they may prove useful,
http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb36d5358411d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb36d5358411d1829f0000e829fbfe/content.htm
thanks and regards
srikanth.p
2009 Jun 10 10:54 AM
2009 Jun 10 11:03 AM
Hi varsha,
Hope this answers your question.
Collect: it adds the numeric fields to the existing non numeric key field records, thereby avoiding duplicate values.
Append : will simply add the records.
2009 Jun 10 11:09 AM
Hi,
If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry.
Regards,
Jyothi CH.