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 abstract classes
What is sapnet?
What two statements would be used to exchange data between programs using abap memory?
how to change output option of table control?
Hi, I have 100 records in a table, how to read every 7Th record each in that...
What are the field and chain statements?
WHAT IS DIFFERENCE BETWEEN USER EXIT AND BADI
What is view? Different types of view.
Explain the disadvantage of using exec sql statement in abap?
How to create a button in selection screen ?
What is sap abap tables?
How do you do BDC?