What is a collect statement? How is it different from append?

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.

Showing Answers 1 - 16 of 16 Answers

sivanagalakshmi

  • Oct 3rd, 2006
 

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

  Was this answer useful?  Yes

shail3234

  • Sep 5th, 2011
 

append vs append lines
insert vs insert lines
CLEAR VS REFRESH
LOOP VS READ
APPEND VS COLLECT

  Was this answer useful?  Yes

vijjy

  • Oct 31st, 2011
 

APPEND:

APPEND statement is used to append(insert) a record at the end of an internal table.here it will not check weather the record is existed with the same field values or not.

Syntax: APPEND wa TO itab.

COLLECT:

COLLECT statement is used to add the numeric field values of an existing record(if all the other field values are equal to the existing record) or inserting a new rcord(if any one of the other field value is different).

Syntax: COLLECT wa INTO itab.

  Was this answer useful?  Yes

mgn varma

  • Mar 11th, 2012
 

collect statement will remove the duplication while adding the records whereas append statement keeps on appending the records any number of times

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions