COLLECT Keyword - Introduction, Syntax & It's Importance - SAP ABAP.
Submitted By: Shilpa Gunjan (LnT Infotech) COLLECT Keyword/Statement is used to add or insert a new entry in internal table without creating duplicate entries. COLLECT statement doesn't directly append the new entry to the internal table rather it first checks in the internal table for any record matching the key in the work area or the header line data. If no matching records are found, then the new data in the work area or the header line will be inserted to the internal table. But in case if any record found with the same key, then instead of inserting a new record, it will add the numeric values of the work area or header line with the matched record and update the internal table record. In simple terms, COLLECT keyword is used to fill an internal table without creating duplicate entries and add up the packed, integer and floating point fields at the same time. Numeric fields include Integer (I), Packed (P) and Floating (F) data types. In case if it’s a