difference between append and collect statement?
Answers were Sorted based on User's Feedback
Answer / sravan
APPEND statement adds the record to the internal table
body.We can't say it adds the new record at the end of the
internal table. It all depends on the type of the internal
table (standard,sorted or Hashed).
COLLECT statement searches for the data in the char type
fields and adds the numeric value.
eg.
if itab contains fields f1 and f2 f1 of char type and f2 of
numc type.
if itab contains data like this.
f1 f2
A 5
b 30
c 10
if we give collect stament like collect itab ( A and 15 as
values)
the data in the itab will become.
f1 f2
A 20
b 30
c 10
this is how it works
Is This Answer Correct ? | 12 Yes | 1 No |
Answer / aditya
append adds to end of the internal table, irrespective if
the same data was present or not.
collect doesnt add duplicate records as it searches for the key.
Is This Answer Correct ? | 7 Yes | 3 No |
Answer / chvpavankumar
append adds the recoed to table body
collect first search for the non numeric fields.if it same
adds the numeric values
Is This Answer Correct ? | 3 Yes | 6 No |
Answer / sainath
Append statement appends the contents of the header line at
the end of the internal table.
The Collect statement includes the header line of the
internal table in the table as the new entry or adds it to
the existing entry of the same type.
Is This Answer Correct ? | 0 Yes | 9 No |
what is vbeln?
What is a table attribute?
Can we write inner join between transparent table and cluster table? If both having common fields?
What does the insert statement in extract datasets do? : abap modularization
What are user exits? What is involved in writing them? What precautions are needed?
What is user exists?
2 Answers FutureSoft, Unilogic Software,
How to declare an Internal Table?
How to raise an exception in Function Module?
what is partner profile. in which table it can be stored
What are the two methods for modifying sap standard tables?
There is a Database Table of Student Details with Fields Student Id, Student Name, Class ID and Rank. Now how to fetch the first three students with highest ranks from all Classes.
if multiple badi can be active at a time, how will we know which implementation will be fired first . how to know the sequence in which implementation is fired.