<?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: Keywords in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385630#M187764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you are looping at a sorted table, there events can be used at specific places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT FIRST / AT LAST will be fired at the starting and ending of the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW / AT END fire on specific columns. When you have column which changes the values, whenever there is a change in the value, the event fires. Similary when the value end AT END fires.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that answers the difference between AT FIRST and AT NEW as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jun 2006 11:25:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-21T11:25:15Z</dc:date>
    <item>
      <title>Keywords</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385626#M187760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi All,&lt;/P&gt;&lt;P&gt;  Can anyone tell me the use of At new , At First, At Last, At END of. Also tell the differnce between At new and At first with example.&lt;/P&gt;&lt;P&gt;Points will be rewarded.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Harpreet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 11:16:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385626#M187760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T11:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Keywords</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385627#M187761</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;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt;You could have found lot of threads on this topic... if you had searched the form before posting this question.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Anyway... check the following...&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Control level processing&lt;/P&gt;&lt;P&gt;Control level processing is allowed within a LOOP over an internal table. This means that you can divide sequences of entries into groups based on the contents of certain fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables are divided into groups according to the sequence of the fields in the line structure. The first column defines the highest control level and so on. The control level hierarchy must be known when you create the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The control levels are formed by sorting the internal table in the sequence of its structure, that is, by the first field first, then by the second field, and so on. Tables in which the table key occurs at the start of the table are particularly suitable for control level processing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following diagram illustrates control level processing in a sorted table, where different field contents in the first three fields are indicated by different colors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each change of color in a column indicates a control level change in the corresponding hierarchy level. Within the processing block of a loop, you can use the control level statement AT to react to a control level change. This enables you to restrict statements to a certain set of lines. You can thus use the SUMstatement to calculate totals from subsets of all lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The AT statement introduces a statement block that you end with the ENDAT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT level.&lt;/P&gt;&lt;P&gt;  statement block&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can react to the following control level changes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;level&lt;/P&gt;&lt;P&gt; Meaning&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FIRST&lt;/P&gt;&lt;P&gt; First line of the internal table&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LAST&lt;/P&gt;&lt;P&gt; Last line of the internal table&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;NEW f&lt;/P&gt;&lt;P&gt; Beginning of a group of lines with the same contents in the field f and in the fields left of f&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;END Of f&lt;/P&gt;&lt;P&gt; End of a group of lines with the same contents in the field f and in the fields left of f&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use control level statements to react to control breaks in internal tables instead of programming them yourself with logical expressions. Within the loop, you must order the AT-ENDATstatement blocks according to the hierarchy of the control levels. If the internal table itab has the columns f1, f2,.... and if it is sorted by these columns, you must program the loop as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;  AT FIRST.... ENDAT.&lt;/P&gt;&lt;P&gt;    AT NEW f1....... ENDAT.&lt;/P&gt;&lt;P&gt;      AT NEW f2....... ENDAT.&lt;/P&gt;&lt;P&gt;     ....... &lt;/P&gt;&lt;P&gt;          single record processing&lt;/P&gt;&lt;P&gt;     ....... &lt;/P&gt;&lt;P&gt;      AT END OF f2.... ENDAT.&lt;/P&gt;&lt;P&gt;    AT END OF f1.... ENDAT.&lt;/P&gt;&lt;P&gt;  AT LAST..... ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The innermost hierarchy level single line processing processes the table lines that do not correspond to a control level change. You do not have to use all control level statements. But you must place the ones that you use in the above sequence. You should not use control level statements in loops where the line selection is restricted by WHERE or FROM and TO. Neither should the table be modified during the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a control level field f1, f2,.... is not known until runtime, you can specify it dynamically as (n1), (n2), &amp;#133; where n1, n2,.... contains the field of f1, f2,.... . If n1, n2,....  is empty at runtime, the criterion for changing the control level is ignored. You can further restrict the group level fields  f1, f2,.... to partial fields by specifying offset and length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are working with a work area wa, it does not contain the current line in the AT-ENDATstatement block. All character fields to the right of the current group key are filled with asterisks (*). All other fields to the right of the current group key contain their initial value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within an AT-ENDAT block, you can calculate the contents of the numeric fields of the corresponding control level using the SUMstatement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can only use this statement within a LOOP. If you use SUM in an AT-ENDAT block, the system calculates totals for the numeric fields of all lines in the current line group and writes them to the corresponding fields in the work area (see example in  ). If you use the SUM statement outside an AT-ENDAT block (single entry processing), the system calculates totals for the numeric fields of all lines of the internal table in each loop pass and writes them to the corresponding fields of the work area. It therefore only makes sense to use the SUM statement in AT-ENDAT blocks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the table contains a nested table, you cannot use the SUMstatement. Neither can you use it if you are using a field symbol instead of a work area in the LOOP 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;REPORT demo_int_tables_at_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF line,&lt;/P&gt;&lt;P&gt;         col1(1) TYPE c,&lt;/P&gt;&lt;P&gt;         col2 TYPE i,&lt;/P&gt;&lt;P&gt;         col3 TYPE i,&lt;/P&gt;&lt;P&gt;      END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab LIKE HASHED TABLE OF line&lt;/P&gt;&lt;P&gt;          WITH UNIQUE KEY col1 col2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;line-col1 = 'A'.&lt;/P&gt;&lt;P&gt;DO 3 TIMES.&lt;/P&gt;&lt;P&gt;  line-col2 = sy-index.&lt;/P&gt;&lt;P&gt;  line-col3 = sy-index ** 2.&lt;/P&gt;&lt;P&gt;  INSERT line INTO TABLE itab.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;line-col1 = 'B'.&lt;/P&gt;&lt;P&gt;DO 3 TIMES.&lt;/P&gt;&lt;P&gt;  line-col2 = 2 * sy-index.&lt;/P&gt;&lt;P&gt;  line-col3 = ( 2 * sy-index ) ** 2.&lt;/P&gt;&lt;P&gt;  INSERT line INTO TABLE itab.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO line.&lt;/P&gt;&lt;P&gt;  WRITE: / line-col1, line-col2, line-col3.&lt;/P&gt;&lt;P&gt;  AT END OF col1.&lt;/P&gt;&lt;P&gt;    SUM.&lt;/P&gt;&lt;P&gt;    ULINE.&lt;/P&gt;&lt;P&gt;    WRITE: / line-col1, line-col2, line-col3.&lt;/P&gt;&lt;P&gt;    SKIP.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;  AT LAST.&lt;/P&gt;&lt;P&gt;    SUM.&lt;/P&gt;&lt;P&gt;    ULINE.&lt;/P&gt;&lt;P&gt;    WRITE: / line-col1, line-col2, line-col3.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The list output is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A          1          1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A          2          4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A          3          9&lt;/P&gt;&lt;P&gt;________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A          6         14&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B          2          4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B          4         16&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B          6         36&lt;/P&gt;&lt;P&gt;________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B         12         56&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        18         70&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program creates a hashed table itab, fills it with six lines, and sorts it. In the LOOP - ENDLOOP block, the work area LINE is output for each loop pass. The first field of the table key, col1, is used for control level processing. The total for all numeric fields is always calculated when the contents of col1 change and when the system is in the last loop pass. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; REPORT demo_int_tables_at_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF line,&lt;/P&gt;&lt;P&gt;        carrid   TYPE sbook-carrid,&lt;/P&gt;&lt;P&gt;        connid   TYPE sbook-connid,&lt;/P&gt;&lt;P&gt;        fldate   TYPE sbook-fldate,&lt;/P&gt;&lt;P&gt;        custtype TYPE sbook-custtype,&lt;/P&gt;&lt;P&gt;        class    TYPE sbook-class,&lt;/P&gt;&lt;P&gt;        bookid   TYPE sbook-bookid,&lt;/P&gt;&lt;P&gt;      END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab LIKE SORTED TABLE OF line WITH UNIQUE KEY table_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT carrid connid fldate custtype class bookid&lt;/P&gt;&lt;P&gt;       FROM sbook INTO CORRESPONDING FIELDS OF TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  AT FIRST.&lt;/P&gt;&lt;P&gt;    WRITE / 'List of Bookings'.&lt;/P&gt;&lt;P&gt;    ULINE.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT NEW carrid.&lt;/P&gt;&lt;P&gt;      WRITE: / 'Carrid:', line-carrid.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      AT NEW connid.&lt;/P&gt;&lt;P&gt;        WRITE: / 'Connid:', line-connid.&lt;/P&gt;&lt;P&gt;      ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        AT NEW fldate.&lt;/P&gt;&lt;P&gt;          WRITE: / 'Fldate:', line-fldate.&lt;/P&gt;&lt;P&gt;        ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          AT NEW custtype.&lt;/P&gt;&lt;P&gt;            WRITE: / 'Custtype:', line-custtype.&lt;/P&gt;&lt;P&gt;          ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;               WRITE: / line-bookid, line-class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            AT END OF class.&lt;/P&gt;&lt;P&gt;              ULINE.&lt;/P&gt;&lt;P&gt;            ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example, the sorted internal table itab is filled with data from the database table SBOOK using the Open SQL statement SELECT. The sequence of the columns in the internal table defines the control level hierarchy. Since the table key is the entire line, the sort sequence and the control level hierarchy are the same. The sequence of the AT-ENDAT blocks within the LOOP - ENDLOOP statements is important.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output looks something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;List of Bookings&lt;/P&gt;&lt;P&gt;Carrid: AA&lt;/P&gt;&lt;P&gt;Connid: 0017&lt;/P&gt;&lt;P&gt;Fldate: 1998/11/22&lt;/P&gt;&lt;P&gt;Custtype: B&lt;/P&gt;&lt;P&gt;00063509 C&lt;/P&gt;&lt;P&gt;00063517 C&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;______________________________________________&lt;/P&gt;&lt;P&gt;00063532 F&lt;/P&gt;&lt;P&gt;00063535 F&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;______________________________________________&lt;/P&gt;&lt;P&gt;Custtype: P&lt;/P&gt;&lt;P&gt;00063653 C&lt;/P&gt;&lt;P&gt;00063654 C&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;______________________________________________&lt;/P&gt;&lt;P&gt;00063668 F&lt;/P&gt;&lt;P&gt;00063670 F&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;______________________________________________&lt;/P&gt;&lt;P&gt;Fldate: 1998/29/11&lt;/P&gt;&lt;P&gt;Custtype: B&lt;/P&gt;&lt;P&gt;00064120 C&lt;/P&gt;&lt;P&gt;00064121 C&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer:  &lt;A href="http://help.sap.com/saphelp_erp2005/helpdata/en/fc/eb3000358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005/helpdata/en/fc/eb3000358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Bharat Kumar Reddy.V&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Bharat Kumar Reddy Vaka&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 11:24:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385627#M187761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T11:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Keywords</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385628#M187762</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;Check this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9f1f35c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9f1f35c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Laxman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 11:24:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385628#M187762</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-06-21T11:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Keywords</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385629#M187763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check the following Documents&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. AT NEW f. &lt;/P&gt;&lt;P&gt;2. AT END OF f. &lt;/P&gt;&lt;P&gt;3. AT FIRST. &lt;/P&gt;&lt;P&gt;4. AT LAST. &lt;/P&gt;&lt;P&gt;5. AT fg. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;In a LOOP which processes a dataset created with EXTRACT , you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT . The sequence of statements which lies between them is then executed if a control break occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use these key words for control break processing with extract datasets only if the active LOOP statement is proceesing an extract dataset. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The control level structure with extract datasets is dynamic. It corresponds exactly to the sort key of the extract dataset, i.e. to the order of fields in the field group HEADER by which the extract dataset was sorted . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of a control group ( AT END OF , AT LAST ), there are two types of control level information between AT and ENDAT : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the sort key of the extract dataset contains a non-numeric field h (particularly in the field group HEADER ), the field CNT(h) contains the number of control breaks in the (subordinate) control level h . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For extracted number fields g (see also ABAP/4 number types ), the fields SUM(g) contain the relevant control totals. &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;The fields CNT(h) and SUM(g) can only be addressed after they have been sorted. Otherwise, a runtime error may occur. &lt;/P&gt;&lt;P&gt;The fields CNT(h) and SUM(g) are filled with the relevant values for a control level at the end of each control group ( AT END OF , AT LAST ), not at the beginning ( AT FIRST , AT NEW ). &lt;/P&gt;&lt;P&gt;When calculating totals with SUM(g) , the system automatically chooses the maximum field sizes so that an overflow occurs only if the absolute value area limits are exceeded. &lt;/P&gt;&lt;P&gt;You can also use special control break control structures with LOOP s on internal tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 1&lt;/P&gt;&lt;P&gt;AT NEW f. &lt;/P&gt;&lt;P&gt;Variant 2&lt;/P&gt;&lt;P&gt;AT END OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;f is a field from the field group HEADER . The enclosed sequence of statements is executed if &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the field f occurs in the sort key of the extract dataset (and thus also in the field group HEADER ) and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the field f or a superior sort criterion has a different value in the current LOOP line than in the prceding ( AT NEW ) or subsequent ( AT END OF ) record of the extract dataset. &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;&lt;/P&gt;&lt;P&gt;DATA: NAME(30),&lt;/P&gt;&lt;P&gt;SALES TYPE I.&lt;/P&gt;&lt;P&gt;FIELD-GROUPS: HEADER, INFOS.&lt;/P&gt;&lt;P&gt;INSERT: NAME INTO HEADER,&lt;/P&gt;&lt;P&gt;SALES INTO INFOS.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;LOOP.&lt;/P&gt;&lt;P&gt;AT NEW NAME.&lt;/P&gt;&lt;P&gt;NEW-PAGE.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;AT END OF NAME.&lt;/P&gt;&lt;P&gt;WRITE: / NAME, SUM(SALES).&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&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;If the extract dataset is not sorted before processing with LOOP , no control level structure is defined and the statements following AT NEW or AT END OF are not executed. &lt;/P&gt;&lt;P&gt;Fields which stand at hex zero are ignored by the control break check with AT NEW or AT END OF . This corresponds to the behavior of the SORT statement, which always places unoccupied fields (i.e. fields which stand at hex zero) before all occupied fields when sorting extract datasets, regardless of whether the sort sequence is in ascending or descending order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 3&lt;/P&gt;&lt;P&gt;AT FIRST. &lt;/P&gt;&lt;P&gt;Variant 4&lt;/P&gt;&lt;P&gt;AT LAST. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Executes the relevant series of statements just once - either on the first loop pass (with AT FIRST ) or on the last loop pass (with AT LAST ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 5&lt;/P&gt;&lt;P&gt;AT fg. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... WITH fg1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;This statement makes single record processing dependent on the type of extracted record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sequence of statements following AT fg are executed whenever the current LOOP record is created with EXTRACT fg (in other words: when the current record is a fg record). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition&lt;/P&gt;&lt;P&gt;... WITH fg1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Executes the sequence of statements belonging to AT fg WITH fg1 only if the record of the field group fg in the dataset is immediately followed by a record of the field group fg1 . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basic form&lt;/P&gt;&lt;P&gt;ON CHANGE OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... OR f1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Executes the processing block enclosed by the " ON CHANGE OF f " and " ENDON " statements whenever the contents of the field f change (control break processing). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally, you use the statement to manipulate database fields during GET events or SELECT / ENDSELECT processing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;There are special control structures for processing control breaks in LOOP s on internal tables or extract datasets AT ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON CHANGE OF is unsuitable for recognizing control levels in loops of this type because it always creates a global auxiliary field which is used to check for changes. This global auxiliary field can only be changed in the relevant ON CHANGE OF statement. It is not reset when the processing goes into loops or subroutines, so unwanted effects can occur if the loop or subroutine is executed again. Also, since it is set to its initial value when created (like any other field), any ON CHANGE OF processing will be executed after the first test, unless the contents of the field concerned happen to be identical to the initial value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES T100.&lt;/P&gt;&lt;P&gt;SELECT * FROM T100 WHERE SPRSL = SY-LANGU AND&lt;/P&gt;&lt;P&gt;MSGNR &amp;lt; '010'&lt;/P&gt;&lt;P&gt;ORDER BY PRIMARY KEY.&lt;/P&gt;&lt;P&gt;ON CHANGE OF T100-ARBGB.&lt;/P&gt;&lt;P&gt;ULINE.&lt;/P&gt;&lt;P&gt;WRITE: / '**&lt;STRONG&gt;', T100-ARBGB, '&lt;/STRONG&gt;**'.&lt;/P&gt;&lt;P&gt;ENDON.&lt;/P&gt;&lt;P&gt;WRITE: / T100-MSGNR, T100-TEXT.&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;Displays all messages with their numbers in the logon language, provided the number is less than '010'. &lt;/P&gt;&lt;P&gt;Each time the message class changes, it is output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition&lt;/P&gt;&lt;P&gt;... OR f1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Also executes the code whenever the contents of the field f1 changes. &lt;/P&gt;&lt;P&gt;You can use this addition several times. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Logical database F1S&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES: SPFLI, SFLIGHT, SBOOK.&lt;/P&gt;&lt;P&gt;GET SBOOK.&lt;/P&gt;&lt;P&gt;ON CHANGE OF SPFLI-CARRID OR&lt;/P&gt;&lt;P&gt;SPFLI-CONNID OR&lt;/P&gt;&lt;P&gt;SFLIGHT-FLDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ULINE.&lt;/P&gt;&lt;P&gt;WRITE: /5 SPFLI-CARRID, SPFLI-CONNID,&lt;/P&gt;&lt;P&gt;5 SFLIGHT-FLDATE, SPFLI-FLTIME,&lt;/P&gt;&lt;P&gt;5 SFLIGHT-SEATSMAX, SFLIGHT-SEATSOCC.&lt;/P&gt;&lt;P&gt;ENDON.&lt;/P&gt;&lt;P&gt;WRITE: / SBOOK-CUSTOMID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code between ON CHANGE OF and ENDON is executed only if at least one of the fields SPFLI-CARRID , SPFLI-CONNID or SFLIGHT-FLDATE has changed, i.e. there is a different flight connection (which also has bookings). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can search for "Differnce between AT NEW AND ON CHANGE OF " for further reference&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 11:25:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385629#M187763</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T11:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Keywords</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385630#M187764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you are looping at a sorted table, there events can be used at specific places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT FIRST / AT LAST will be fired at the starting and ending of the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW / AT END fire on specific columns. When you have column which changes the values, whenever there is a change in the value, the event fires. Similary when the value end AT END fires.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that answers the difference between AT FIRST and AT NEW as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 11:25:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385630#M187764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T11:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Keywords</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385631#M187765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Harpreet,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            AT NEW, AT FIRST, AT LAST and AT END OF are control commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before performing any operations on control command you need to SORT the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW will trigger for every new value of that field changes, where as AT FIRST will trigger for the first time on that field and later it wont trigger even the value changes of that field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LAST will trigger for last value of that field.&lt;/P&gt;&lt;P&gt;Generally you specify SUM over here to get totals and subtotals.&lt;/P&gt;&lt;P&gt;AT END OF will trigger at the end of that field changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;For more about control commands,just follow the link&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/at_extra.htm&amp;lt;/b&amp;gt;" target="test_blank"&gt;http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/at_extra.htm&amp;lt;/b&amp;gt;&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 11:28:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385631#M187765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T11:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Keywords</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385632#M187766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   At first-&amp;gt; Will be fired only once at start of loop.&lt;/P&gt;&lt;P&gt;   At last -&amp;gt; Last record this event is fired used &lt;/P&gt;&lt;P&gt;              for printing grand total.&lt;/P&gt;&lt;P&gt;   At new -&amp;gt; At new empno this event is fired&lt;/P&gt;&lt;P&gt;   At end -&amp;gt; At end of empno event is fired. Used&lt;/P&gt;&lt;P&gt;             to print subtotal.&lt;/P&gt;&lt;P&gt;foe example&lt;/P&gt;&lt;P&gt; Empno   sal&lt;/P&gt;&lt;P&gt;  1      2000&lt;/P&gt;&lt;P&gt;  1      3000&lt;/P&gt;&lt;P&gt;  2     7000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; sort itab by empno &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  At first.&lt;/P&gt;&lt;P&gt;    Write: 'Report'.&lt;/P&gt;&lt;P&gt;  endat. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  at new empno.&lt;/P&gt;&lt;P&gt;   write:'Empno,itab-empno .&lt;/P&gt;&lt;P&gt;  endat.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  at end of empno.&lt;/P&gt;&lt;P&gt;   sum.&lt;/P&gt;&lt;P&gt;   write:/'Empno Total:',itab-sal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; //Output we get values &lt;/P&gt;&lt;P&gt;      1   5000&lt;/P&gt;&lt;P&gt;      2   7000  &lt;/P&gt;&lt;P&gt;  endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  at last.&lt;/P&gt;&lt;P&gt;   sum.&lt;/P&gt;&lt;P&gt;   write:/ 'Grand total:',itab-sal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Output here&lt;/P&gt;&lt;P&gt;   grand total:12000&lt;/P&gt;&lt;P&gt;  endat. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; endloop.&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;Amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 11:48:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385632#M187766</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T11:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Keywords</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385633#M187767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai Harpreet Singh&lt;/P&gt;&lt;P&gt;go through the following Link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/at_extra.htm" target="test_blank"&gt;http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/at_extra.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT - Control break with extracts &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variants&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. AT NEW f. &lt;/P&gt;&lt;P&gt;2. AT END OF f. &lt;/P&gt;&lt;P&gt;3. AT FIRST. &lt;/P&gt;&lt;P&gt;4. AT LAST. &lt;/P&gt;&lt;P&gt;5. AT fg. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;In a LOOP which processes a dataset created with EXTRACT , you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT . The sequence of statements which lies between them is then executed if a control break occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use these key words for control break processing with extract datasets only if the active LOOP statement is proceesing an extract dataset. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The control level structure with extract datasets is dynamic. It corresponds exactly to the sort key of the extract dataset, i.e. to the order of fields in the field group HEADER by which the extract dataset was sorted . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of a control group ( AT END OF , AT LAST ), there are two types of control level information between AT and ENDAT : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the sort key of the extract dataset contains a non-numeric field h (particularly in the field group HEADER ), the field CNT(h) contains the number of control breaks in the (subordinate) control level h . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For extracted number fields g (see also ABAP/4 number types ), the fields SUM(g) contain the relevant control totals. &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;The fields CNT(h) and SUM(g) can only be addressed after they have been sorted. Otherwise, a runtime error may occur. &lt;/P&gt;&lt;P&gt;The fields CNT(h) and SUM(g) are filled with the relevant values for a control level at the end of each control group ( AT END OF , AT LAST ), not at the beginning ( AT FIRST , AT NEW ). &lt;/P&gt;&lt;P&gt;When calculating totals with SUM(g) , the system automatically chooses the maximum field sizes so that an overflow occurs only if the absolute value area limits are exceeded. &lt;/P&gt;&lt;P&gt;You can also use special control break control structures with LOOP s on internal tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 1&lt;/P&gt;&lt;P&gt;AT NEW f. &lt;/P&gt;&lt;P&gt;Variant 2&lt;/P&gt;&lt;P&gt;AT END OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;f is a field from the field group HEADER . The enclosed sequence of statements is executed if &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the field f occurs in the sort key of the extract dataset (and thus also in the field group HEADER ) and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the field f or a superior sort criterion has a different value in the current LOOP line than in the prceding ( AT NEW ) or subsequent ( AT END OF ) record of the extract dataset. &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;&lt;/P&gt;&lt;P&gt;DATA: NAME(30),&lt;/P&gt;&lt;P&gt;      SALES TYPE I.&lt;/P&gt;&lt;P&gt;FIELD-GROUPS: HEADER, INFOS.&lt;/P&gt;&lt;P&gt;INSERT: NAME  INTO HEADER,&lt;/P&gt;&lt;P&gt;        SALES INTO INFOS.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;LOOP.&lt;/P&gt;&lt;P&gt;  AT NEW NAME.&lt;/P&gt;&lt;P&gt;    NEW-PAGE.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;  ...&lt;/P&gt;&lt;P&gt;  AT END OF NAME.&lt;/P&gt;&lt;P&gt;    WRITE: / NAME, SUM(SALES).&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&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;If the extract dataset is not sorted before processing with LOOP , no control level structure is defined and the statements following AT NEW or AT END OF are not executed. &lt;/P&gt;&lt;P&gt;Fields which stand at hex zero are ignored by the control break check with AT NEW or AT END OF . This corresponds to the behavior of the SORT statement, which always places unoccupied fields (i.e. fields which stand at hex zero) before all occupied fields when sorting extract datasets, regardless of whether the sort sequence is in ascending or descending order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 3&lt;/P&gt;&lt;P&gt;AT FIRST. &lt;/P&gt;&lt;P&gt;Variant 4&lt;/P&gt;&lt;P&gt;AT LAST. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Executes the relevant series of statements just once - either on the first loop pass (with AT FIRST ) or on the last loop pass (with AT LAST ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 5&lt;/P&gt;&lt;P&gt;AT fg. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... WITH fg1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;This statement makes single record processing dependent on the type of extracted record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sequence of statements following AT fg are executed whenever the current LOOP record is created with EXTRACT fg (in other words: when the current record is a fg record). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition&lt;/P&gt;&lt;P&gt;... WITH fg1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Executes the sequence of statements belonging to AT fg WITH fg1 only if the record of the field group fg in the dataset is immediately followed by a record of the field group fg1 . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Sreenivasulu P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 12:21:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/keywords/m-p/1385633#M187767</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T12:21:47Z</dc:date>
    </item>
  </channel>
</rss>

