<?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 extract in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812208#M657450</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;]]Is it important to know EXTRACT &amp;#150;if for what situations?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Sep 2007 06:14:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-30T06:14:30Z</dc:date>
    <item>
      <title>extract</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812208#M657450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;]]Is it important to know EXTRACT &amp;#150;if for what situations?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2007 06:14:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812208#M657450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-30T06:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: extract</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812209#M657451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, if you are using field groups.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXTRACT&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;EXTRACT [ header | field_group ].&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 links the current content of the fields, which were until then included in the field group header resp. field_group via the statement INSERT , to the extract dataset of the program. If there is no field group specified after EXTRACT, then the field group header is implicitly added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the first execution of the EXTRACT-statement of a program, the extract datset is created and the first line added. After execution of an EXTRACT-statement, it is not allowed to incorporate other fields to the specified field group field_group with the INSERT statement. If you do so, an uncatchable exception will be raised at the next EXTRACT-statement for the same field group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;As the field group header is the beginning part and sort key of every field group, it is not allowed to incorporate fields into header after execution of the first EXTRACT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The lines of an extract dataset cannot be explicitly deleted and will be kept alive as long as the internal mode of the program.&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;This example continues the example under INSERT. If the executable program is linked to a fitting logical data base, the fields of the field groups flight_info and flight_date are attached to the extract dataset during the GET-events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_extract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NODES: spfli, sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-GROUPS: header, flight_info, flight_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT: spfli-carrid spfli-connid sflight-fldate&lt;/P&gt;&lt;P&gt;INTO header,&lt;/P&gt;&lt;P&gt;spfli-cityfrom spfli-cityto&lt;/P&gt;&lt;P&gt;INTO flight_info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET spfli.&lt;/P&gt;&lt;P&gt;EXTRACT flight_info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET sflight.&lt;/P&gt;&lt;P&gt;EXTRACT flight_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9ed135c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9ed135c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2007 06:22:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812209#M657451</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-30T06:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: extract</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812210#M657452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements: EXTRACT . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset EXTRACT HEADER. When you extract the data, the record is filled with the current values of the corresponding fields. As soon as the system has processed the first EXTRACT statement for a field group , the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups and HEADER. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs. By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program.&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;Sravanthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 06:12:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812210#M657452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T06:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: extract</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812211#M657453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sir ,&lt;/P&gt;&lt;P&gt;Please have a look below .Hope it is suitable and simpler solution for your question.&lt;/P&gt;&lt;P&gt;Please do reward if useful.&lt;/P&gt;&lt;P&gt;Thankx.&lt;/P&gt;&lt;P&gt;What is the difference between 'extract' and 'collect' statements? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXTRACT &amp;lt;fg&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each extract record contains exactly those fields that are contained in the field group &amp;lt;fg&amp;gt;, plus the fields of the field group HEADER (if one exists). The fields from HEADER occur as a sort key at the beginning of the record. If you do not explicitly specify a field group &amp;lt;fg&amp;gt;, the EXTRACT statement is a shortened form of the statement extracts used in field groups (version 2.x - obsolete these days as noone uses field groups anymore), and collect is used to accumulate the contents of a field if X no. of keys are the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXTRACT HEADER. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you extract the data, the record is filled with the current values of the corresponding fields.  As soon as the system has processed the first EXTRACT statement for a field group &amp;lt;fg&amp;gt;, the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups &amp;lt;fg&amp;gt; and HEADER. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program. &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;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;You should only use the COLLECT statement if you want to create summarized tables. If you use other statements to insert table entries, you may end up with duplicate entries.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EG:&lt;/P&gt;&lt;P&gt;Field groups are groups similar fields together into one name. Field group works in conjuction with     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT f1 f2 INTO fg &lt;/P&gt;&lt;P&gt;EXTRACT fg &lt;/P&gt;&lt;P&gt;SORT BY fg &lt;/P&gt;&lt;P&gt;LOOP ... ENDLOOP &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT f1 f2 INTO fg &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The insert statement is used to create a field group dynamically by inserting the field into it. Only global data fields can be inserted and not local data fields eg : in form modules. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXTRACT fg &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will combine all the fields in the fieldgroup and write them to a sequential dataset as a single record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT BY fg &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorting of sequential dataset by field group. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AND ENDLOOP &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP. &lt;/P&gt;&lt;P&gt;  AT *** &lt;/P&gt;&lt;P&gt;...... &lt;/P&gt;&lt;P&gt;.... &lt;/P&gt;&lt;P&gt;ENDAT. &lt;/P&gt;&lt;P&gt;  AT *** &lt;/P&gt;&lt;P&gt;..... &lt;/P&gt;&lt;P&gt;.... &lt;/P&gt;&lt;P&gt;ENDAT. &lt;/P&gt;&lt;P&gt;ENDLOOP.                          *-- Chinmaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 06:26:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812211#M657453</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T06:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: extract</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812212#M657454</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;Extract will retrieve the data from database and populates in the structure created by field group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 06:28:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812212#M657454</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T06:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: extract</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812213#M657455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is slight difficulty&lt;/P&gt;&lt;P&gt;I am not getting the &lt;STRONG&gt;difference&lt;/STRONG&gt; of the dynamic aspects between the &lt;STRONG&gt;internal table &amp;amp; extracts&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Also "_Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program._" -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;is given but what I have understood is that upto this point  that is first usage  we can change the internal tables also &lt;U&gt;isn't it?&lt;/U&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Dec 2007 06:27:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extract/m-p/2812213#M657455</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-30T06:27:51Z</dc:date>
    </item>
  </channel>
</rss>

