<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: collect append in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451887#M829279</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;COLLECT is to create totals within an internal table.it compares non-numeric fields in the header line aganist the non-numeric fields in the body, then the nemeric fields are added when the exact match found.if they are not matched then it just insert that record into body.&lt;/P&gt;&lt;P&gt;APPEND is to push the record from the header line to the bottom of body of an internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Feb 2008 08:45:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-26T08:45:34Z</dc:date>
    <item>
      <title>collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451876#M829268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi frds plz give meresponse to this question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Difference between COLLECT &amp;amp; APPEND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;give me my mail id  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sudhakarbabu786@rediffmail.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 08:20:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451876#M829268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T08:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451877#M829269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND :append statement will just append a new row into the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;collect: collect statement serve dual purpose . if the key field is already present in the table then it will add the integer field of new record to the exist record otherwise it will create a new record&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 08:26:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451877#M829269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T08:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451878#M829270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both statement used to populate data in internal table whan u use append statement then a new record has been appended to internal table and when u use collect statement then program will check key for character fields and for same character fields it will add all numeric fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;APPEND line_spec TO itab SORTED BY comp result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition: &lt;/P&gt;&lt;P&gt;... SORTED BY comp &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This statement appends one or more rows line_spec to an internal index table itab. If itab is a standard table, you can use SORTED BY to sort the table in a specified way. Use result when appending a single row as of release 6.10 to set a reference to the appended row in the form of a field symbol or a data reference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the individual table types, appending is done as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To standard tables, rows are appended directly and without checking the content of the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To sorted tables, rows are appended only if they correspond to the sort sequence and do not create duplicate entries with unique table key. Otherwise, an untreatable exception is triggered. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To hashed tables, no rows can be appended. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The APPEND statement sets sy-tabix to the table index of the last appended row. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition &lt;/P&gt;&lt;P&gt;... SORTED BY comp &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This addition is allowed only if you specify a workarea wa and if you use a standard table, where wa must be compatible to the row type of the table. You can specify component comp as shown in section Specifying Components, however, you can access only one single component and no attributes of classes using the object component selector. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The statement is executed in two steps: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Starting at the last row, the table is searched for a row, in which the value of component comp is greater than or equal to the value of component comp of wa. If such a row exists, the workarea wa is included after this row. If no such row exists, the workarea wa is included before the first row. The table index of all rows following the included rows increases by one. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the number of rows before the statement is executed is greater than or equal to the number specified in the definition of the internal table in the INITIAL SIZE addition, the newly-created last row is deleted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;When using only the statement APPEND with addition SORTED BY to fill an internal table, this rule results in an internal table that contains no more than the number of rows specified in its definition after INITIAL SIZE and that is sorted in descending order by component comp (ranking). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SORT statement should usually be used instead of APPEND SORTED BY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Creating a ranking of the three flights of a connection showing the most free seats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_carrid TYPE sflight-carrid, &lt;/P&gt;&lt;P&gt;p_connid TYPE sflight-connid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF seats, &lt;/P&gt;&lt;P&gt;fldate TYPE sflight-fldate, &lt;/P&gt;&lt;P&gt;seatsocc TYPE sflight-seatsocc, &lt;/P&gt;&lt;P&gt;seatsmax TYPE sflight-seatsmax, &lt;/P&gt;&lt;P&gt;seatsfree TYPE sflight-seatsocc, &lt;/P&gt;&lt;P&gt;END OF seats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA seats_tab LIKE STANDARD TABLE OF seats &lt;/P&gt;&lt;P&gt;INITIAL SIZE 3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT fldate seatsocc seatsmax &lt;/P&gt;&lt;P&gt;FROM sflight &lt;/P&gt;&lt;P&gt;INTO seats &lt;/P&gt;&lt;P&gt;WHERE carrid = p_carrid AND &lt;/P&gt;&lt;P&gt;connid = p_connid. &lt;/P&gt;&lt;P&gt;seats-seatsfree = seats-seatsmax - seats-seatsocc. &lt;/P&gt;&lt;P&gt;APPEND seats TO seats_tab SORTED BY seatsfree. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;COLLECT wa INTO itab result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This statement inserts the contents of a work area wa either as single row into an internal table itab or adds the values of its numeric components to the corresponding values of existing rows with the same key. As of Release 6.10, you can use result to set a reference to the inserted or changed row in the form of a field symbol or data reference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prerequisite for the use of this statement is that wa is compatible with the row type of itab and all components that are not part of the table key must have a numeric data type (i, p, f). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In standard tables that are only filled using COLLECT, the entry is determined by a temporarily created hash administration. The workload is independent of the number of entries in the table. The hash administration is temporary and is generally invalidated when the table is accessed for changing. If further COLLECT statements are entered after an invalidation, a linear search of all table rows is performed. The workload for this search increases in a linear fashion in relation to the number of entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In sorted tables, the entry is determined using a binary search. The workload has a logarithmic relationship to the number of entries in the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In hashed tables, the entry is determined using the hash administration of the table and is always independent of the number of table entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If no line is found with an identical key, a row is inserted as described below, and filled with the content of wa: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In standard tables the line is appended. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In sorted tables, the new line is inserted in the sort sequence of the internal table according to its key values, and the table index of subsequent rows is increased by 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In hashed tables, the new row is inserted into the internal table by the hash administration, according to its key values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the internal table already contains one or more rows with an identical key, those values of the components of work area wa that are not part of the key, are added to the corresponding components of the uppermost existing row (in the case of index tables, this is the row with the lowest table index). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The COLLECT statement sets sy-tabix to the table index of the inserted or existing row, in the case of standard tables and sorted tables, and to the value 0 in the case of hashed tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outside of classes, you can omit wa INTO if the internal table has an identically-named header line itab. The statement then implicitly uses the header line as the work area. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT should only be used if you want to create an internal table that is genuinely unique or compressed. In this case, COLLECT can greatly benefit performance. If uniqueness or compression are not required, or the uniqueness is guaranteed for other reasons, the INSERT statement should be used instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of COLLECT for standard tables is obsolete. COLLECT should primarily be used for hashed tables, as these have a unique table key and a stable hash administration. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a standard table is filled using COLLECT, it should not be edited using any other statement with the exception of MODIFY. If the latter is used with the addition TRANSPORTING, you must ensure that no key fields are changed. This is the only way to guarantee that the table entries are always unique and compressed, and that the COLLECT statement functions correctly and benefits performance. The function module ABL_TABLE_HASH_STATE can be used to check whether a standard table is suitable for editing using COLLECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Compressed insertion of data from the database table sflight into the internal table seats_tab. The rows in which the key components carrid and connid are identical are compressed by adding the number of occupied seats to the numeric component seatsocc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF seats, &lt;/P&gt;&lt;P&gt;carrid TYPE sflight-carrid, &lt;/P&gt;&lt;P&gt;connid TYPE sflight-connid, &lt;/P&gt;&lt;P&gt;seatsocc TYPE sflight-seatsocc, &lt;/P&gt;&lt;P&gt;END OF seats. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA seats_tab LIKE HASHED TABLE OF seats &lt;/P&gt;&lt;P&gt;WITH UNIQUE KEY carrid connid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT carrid connid seatsocc &lt;/P&gt;&lt;P&gt;FROM sflight &lt;/P&gt;&lt;P&gt;INTO seats. &lt;/P&gt;&lt;P&gt;COLLECT seats INTO seats_tab. &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpfull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 08:54:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451878#M829270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T08:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451879#M829271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT: When the line is inserted, the system checks whether there is already a table entry that matches the key. If there is no corresponding entry already in the table, the COLLECT statement has the same effect as inserting the new line. 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.  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;APPEND :  inserting the new line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 09:17:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451879#M829271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T09:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451880#M829272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Append:&lt;/STRONG&gt;This statement appends one or more rows line_spec to an internal index table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Collect&lt;/STRONG&gt;:This statement inserts the contents of a work area wa either as single row into an internal table itab or adds the values of its numeric components to the corresponding values of existing rows with the same key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;kavitha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 09:18:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451880#M829272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T09:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451881#M829273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;collect----- checks whether it is there or not. if there adds integer,  packed, float otherwise remove &lt;/P&gt;&lt;P&gt; append-----just adding&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 09:23:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451881#M829273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T09:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451882#M829274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Append statement only add that particular record it the end it is not going to check whether that record exists or not? But collect statement going to check the record exists or not? If it exists then it will check the all character feilds . If they are same then it will add all the numeric feilds. Otherwise it works same as append. &lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Sarada&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 10:03:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451882#M829274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T10:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451883#M829275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;COLLECT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Aggregates lines and then adds them to an internal table.&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;COLLECT &amp;lt;line&amp;gt; INTO &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;       [ASSIGNING &amp;lt;FS&amp;gt; | REFERENCE INTO &amp;lt;dref&amp;gt;].&lt;/P&gt;&lt;P&gt;The system checks whether there is already a table entry that matches the key. If there is no corresponding entry already in the table, the COLLECT statement has the same effect as INSERT. 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 &amp;lt;line&amp;gt; to the contents of the fields in the existing entry. If you use ASSIGNING or INTO REFERENCE, field symbol &amp;lt;FS&amp;gt; refers to the inserted line or the relevant data reference is stored in &amp;lt;dref&amp;gt; after the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;APPEND&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Appends a line or multiple lines to the end of an index table.&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;APPEND &amp;lt;line&amp;gt;|LINES OF &amp;lt;jtab&amp;gt; TO &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;       [ASSIGNING &amp;lt;FS&amp;gt; | REFERENCE INTO &amp;lt;dref&amp;gt;].&lt;/P&gt;&lt;P&gt;A line &amp;lt;line&amp;gt; or multiple lines of an internal table &amp;lt;jtab&amp;gt; are appended to index table &amp;lt;itab&amp;gt;. If you use ASSIGNING or INTO REFERENCE, field symbol &amp;lt;FS&amp;gt; refers to the appended line or the relevant data reference is stored in &amp;lt;dref&amp;gt; after the statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 10:13:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451883#M829275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T10:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451884#M829276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appends a line or multiple lines to the end of an index table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND &amp;lt;line&amp;gt;|LINES OF &amp;lt;jtab&amp;gt; TO &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;       [ASSIGNING &amp;lt;FS&amp;gt; | REFERENCE INTO &amp;lt;dref&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A line &amp;lt;line&amp;gt; or multiple lines of an internal table &amp;lt;jtab&amp;gt; are appended to index table &amp;lt;itab&amp;gt;. If you use ASSIGNING or INTO REFERENCE, field symbol &amp;lt;FS&amp;gt; refers to the appended line or the relevant data reference is stored in &amp;lt;dref&amp;gt; after the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aggregates lines and then adds them to an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT &amp;lt;line&amp;gt; INTO &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;       [ASSIGNING &amp;lt;FS&amp;gt; | REFERENCE INTO &amp;lt;dref&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system checks whether there is already a table entry that matches the key. If there is no corresponding entry already in the table, the COLLECT statement has the same effect as INSERT. 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 &amp;lt;line&amp;gt; to the contents of the fields in the existing entry. If you use ASSIGNING or INTO REFERENCE, field symbol &amp;lt;FS&amp;gt; refers to the inserted line or the relevant data reference is stored in &amp;lt;dref&amp;gt; after the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Priya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 10:36:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451884#M829276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T10:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451885#M829277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;COLLECT wa INTO itab [result].&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement inserts the contents of a work area wa either as single row into an internal table itab or adds the values of its numeric components to the corresponding values of existing rows with the same key. As of Release 6.10, you can use result to set a reference to the inserted or changed row in form of a field symbol or data reference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prerequisite for the use of this statement is that wa is compatible with the row type of itab. The row type must be flat and all components that are not part of the table key must have a numeric data type ( i, p, f). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the internal table does not already contain a row with an identical key, the COLLECT statement has the same effect as the following form of the INSERT statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;APPEND&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement appends one or more rows line_spec to an internal index table itab. If itab is a standard table, you can use SORTED BY to sort the table in a specified way. Use result when appending a single row as of release 6.10 to set a reference to the appended row in the form of a field symbol or a data reference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the individual table types, appending is done as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To standard tables, rows are appended directly and without checking the content of the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To sorted tables, rows are appended only if they correspond to the sort sequence and do not create duplicate entries with unique table key. Otherwise, an untreatable exception is triggered. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To hashed tables, no rows can be appended. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The APPEND statement sets sy-tabix to the table index of the last appended row.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2008 10:49:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451885#M829277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-25T10:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451886#M829278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;both collect and append are used to move the date from work area to body.&lt;/P&gt;&lt;P&gt;but the difference is.&lt;/P&gt;&lt;P&gt;  if we use the append,&lt;/P&gt;&lt;P&gt;             records move from work area to body sequentially.&lt;/P&gt;&lt;P&gt;          123456789........like this.&lt;/P&gt;&lt;P&gt;if we use the collect,&lt;/P&gt;&lt;P&gt;       it avoids the  duplicates.&lt;/P&gt;&lt;P&gt;       it adds the duplicate records.&lt;/P&gt;&lt;P&gt; for ex;&lt;/P&gt;&lt;P&gt;  1         300&lt;/P&gt;&lt;P&gt; 1         400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if we use collect a the time it save it as &lt;/P&gt;&lt;P&gt;  1    700&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2008 04:45:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451886#M829278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-26T04:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451887#M829279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;COLLECT is to create totals within an internal table.it compares non-numeric fields in the header line aganist the non-numeric fields in the body, then the nemeric fields are added when the exact match found.if they are not matched then it just insert that record into body.&lt;/P&gt;&lt;P&gt;APPEND is to push the record from the header line to the bottom of body of an internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2008 08:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451887#M829279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-26T08:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451888#M829280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Append will insert line in internal table at last by default.&lt;/P&gt;&lt;P&gt;Collect will create key by combining all charactrer type fields in that internal table. If the same key values are available in that internal table, it will add values of corresponding non character type fields. otherwise it will append that row in internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2008 09:44:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451888#M829280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-26T09:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451889#M829281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Append&lt;/STRONG&gt; :-  it appends the record seguently in internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Insert&lt;/STRONG&gt;  :-   inserts s new record can be inserted either before or after existing record in internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Collect&lt;/STRONG&gt;  :- it  can avoid all duplicat records in internal lable    body&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2008 10:09:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451889#M829281</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-26T10:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: collect append</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451890#M829282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Collect plays major role when we in reports.&lt;/P&gt;&lt;P&gt;append and collect plays same when there is no numeric fields in  the internal table.&lt;/P&gt;&lt;P&gt;if any non-numeric fields are there in the internal table then there is difference between collect and append.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2008 10:17:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-append/m-p/3451890#M829282</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-26T10:17:34Z</dc:date>
    </item>
  </channel>
</rss>

