<?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: loop events in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333657#M513719</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PL check this &amp;lt;a href="https://forums.sdn.sap.com/click.jspa?searchID=3171568&amp;amp;messageID=3369924"&amp;gt;Thread&amp;lt;/a&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2007 02:53:08 GMT</pubDate>
    <dc:creator>suresh_datti</dc:creator>
    <dc:date>2007-06-14T02:53:08Z</dc:date>
    <item>
      <title>loop events</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333655#M513717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;plz explain about at end of? and give me nice example?diff at new and at end of..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 02:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333655#M513717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T02:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: loop events</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333656#M513718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Imagine if ur itab contains&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUMBER&lt;/P&gt;&lt;P&gt;100 -1st&lt;/P&gt;&lt;P&gt;100 -2nd&lt;/P&gt;&lt;P&gt;100 -3rd&lt;/P&gt;&lt;P&gt;200 -4th&lt;/P&gt;&lt;P&gt;200 -5th&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW number - will be trigerred for 1st &amp;amp; 4th&lt;/P&gt;&lt;P&gt;AT END OF number - will be trigerred for 3rd &amp;amp; 5th&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 02:52:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333656#M513718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T02:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: loop events</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333657#M513719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PL check this &amp;lt;a href="https://forums.sdn.sap.com/click.jspa?searchID=3171568&amp;amp;messageID=3369924"&amp;gt;Thread&amp;lt;/a&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 02:53:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333657#M513719</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2007-06-14T02:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: loop events</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333658#M513720</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;      At-new will trigger at the starting of a change and At-End-Of will trigger at the end of that change...Thats all..&lt;/P&gt;&lt;P&gt;See the Simple example given below..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it-f1.&lt;/P&gt;&lt;P&gt;aa  -&amp;gt; at-new will trigger here&lt;/P&gt;&lt;P&gt;aa -&amp;gt;at-end-of will trigger here&lt;/P&gt;&lt;P&gt;ss -&amp;gt;at-new&lt;/P&gt;&lt;P&gt;ss&lt;/P&gt;&lt;P&gt;ss&lt;/P&gt;&lt;P&gt;ss -&amp;gt;at-end&lt;/P&gt;&lt;P&gt;dd -&amp;gt;at-new&lt;/P&gt;&lt;P&gt;dd&lt;/P&gt;&lt;P&gt;dd&lt;/P&gt;&lt;P&gt;dd-&amp;gt;at-end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope u understood.. Also if you give SUM. command after at-end-of you will get all sum of all integer and float type fields. You can try this also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward All Helpfull Answers..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 02:53:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333658#M513720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T02:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: loop events</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333659#M513721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the example code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: sflight_tab TYPE SORTED TABLE OF sflight &lt;/P&gt;&lt;P&gt;WITH UNIQUE KEY carrid connid fldate, &lt;/P&gt;&lt;P&gt;sflight_wa LIKE LINE OF sflight_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;FROM sflight &lt;/P&gt;&lt;P&gt;INTO TABLE sflight_tab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT sflight_tab INTO sflight_wa. &lt;/P&gt;&lt;P&gt;AT NEW connid. &lt;/P&gt;&lt;P&gt;WRITE: / sflight_wa-carrid, &lt;/P&gt;&lt;P&gt;sflight_wa-connid. &lt;/P&gt;&lt;P&gt;ULINE. &lt;/P&gt;&lt;P&gt;ENDAT. &lt;/P&gt;&lt;P&gt;WRITE: / sflight_wa-fldate, &lt;/P&gt;&lt;P&gt;sflight_wa-seatsocc. &lt;/P&gt;&lt;P&gt;AT END OF connid. &lt;/P&gt;&lt;P&gt;SUM. &lt;/P&gt;&lt;P&gt;ULINE. &lt;/P&gt;&lt;P&gt;WRITE: / 'Sum', &lt;/P&gt;&lt;P&gt;sflight_wa-seatsocc UNDER sflight_wa-seatsocc. &lt;/P&gt;&lt;P&gt;SKIP. &lt;/P&gt;&lt;P&gt;ENDAT. &lt;/P&gt;&lt;P&gt;AT END OF carrid. &lt;/P&gt;&lt;P&gt;SUM. &lt;/P&gt;&lt;P&gt;ULINE. &lt;/P&gt;&lt;P&gt;WRITE: / 'Carrier Sum', &lt;/P&gt;&lt;P&gt;sflight_wa-seatsocc UNDER sflight_wa-seatsocc. &lt;/P&gt;&lt;P&gt;NEW-PAGE. &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;WRITE: / 'Overall Sum', &lt;/P&gt;&lt;P&gt;sflight_wa-seatsocc UNDER sflight_wa-seatsocc. &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;Reward points if it is helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 02:54:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333659#M513721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T02:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: loop events</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333660#M513722</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;Suppose if u are displaying report like material details. IF customer wants a total for each material then in this case u should use At end of.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM display_records2 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT gt_ibrostmp1 BY zzasco.&lt;/P&gt;&lt;P&gt;  CLEAR: gv_total_count, gv_total_amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display the selected records from internal table gt_vvscpos.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT gt_ibrostmp1 INTO gs_ibrostmp1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If new ASCO company code comes then clear the gv_count and gv_total_amount&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    AT NEW zzasco.&lt;/P&gt;&lt;P&gt;      CLEAR: gv_count,gv_total_amount.&lt;/P&gt;&lt;P&gt;      gv_count = 0.&lt;/P&gt;&lt;P&gt;      gv_total_amount = 0.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Calculate the no.of records and total amount for each ASCO Company code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    gv_count   = gv_count + 1.&lt;/P&gt;&lt;P&gt;    gv_total_amount = gv_total_amount + gs_ibrostmp1-total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;At end of each ASCO Company code, display the total no.of record and amount&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    AT END OF zzasco.&lt;/P&gt;&lt;P&gt;      WRITE:/ sy-vline,  6 gs_ibrostmp1-zzasco COLOR COL_KEY,&lt;/P&gt;&lt;P&gt;           30 sy-vline, 31 gv_count          COLOR COL_NORMAL,&lt;/P&gt;&lt;P&gt;           45 sy-vline, 46 gv_total_amount   COLOR COL_NORMAL,&lt;/P&gt;&lt;P&gt;           80 sy-vline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;calculate the total no.of records and total amount&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      gv_total_count   = gv_total_count   + gv_count.&lt;/P&gt;&lt;P&gt;      gv_total_amount1 = gv_total_amount1 + gv_total_amount.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;At last display the total no.of records and total amount&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    AT LAST.&lt;/P&gt;&lt;P&gt;      ULINE (80).&lt;/P&gt;&lt;P&gt;      WRITE:/ sy-vline,  'Total'(001)        COLOR COL_KEY,&lt;/P&gt;&lt;P&gt;           30 sy-vline, 31 gv_total_count    COLOR COL_TOTAL,&lt;/P&gt;&lt;P&gt;           45 sy-vline, 46 gv_total_amount1  COLOR COL_TOTAL,&lt;/P&gt;&lt;P&gt;           80 sy-vline.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  ULINE (80).&lt;/P&gt;&lt;P&gt;ENDFORM.                    " display_records2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward me if its useful..&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>Thu, 14 Jun 2007 02:54:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333660#M513722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T02:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: loop events</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333661#M513723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ram,&lt;/P&gt;&lt;P&gt;This is the SAP documentation on AT END OF and AT NEW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW f. &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 sub-field of an internal table or extract dataset (EXTRACT) which is being processed with LOOP, i.e. the variants 1 and 2 only make sense within a LOOP. &lt;/P&gt;&lt;P&gt;Both "AT NEW f." and "AT END OF f. " introduce processing blocks which are concluded by " ENDAT.". &lt;/P&gt;&lt;P&gt;These processing blocks are processed whenever the contents of a field f or a sub-field defined before f change as a result of processing with LOOP. "AT NEW f." begins a new group of (table) lines with the same contents as the field f while "AT END OF f." concludes such a group. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the AT ... ENDAT processing of internal tables, all argument fields following f are filled with "*". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples &lt;/P&gt;&lt;P&gt;1. AT for sub-fields of an internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF COMPANIES OCCURS 20, &lt;/P&gt;&lt;P&gt;        NAME(30), &lt;/P&gt;&lt;P&gt;        PRODUCT(20), &lt;/P&gt;&lt;P&gt;        SALES TYPE I, &lt;/P&gt;&lt;P&gt;      END   OF COMPANIES. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;LOOP AT COMPANIES. &lt;/P&gt;&lt;P&gt;  AT NEW NAME. &lt;/P&gt;&lt;P&gt;    NEW-PAGE. &lt;/P&gt;&lt;P&gt;    WRITE / COMPANIES-NAME. &lt;/P&gt;&lt;P&gt;  ENDAT. &lt;/P&gt;&lt;P&gt;  WRITE: / COMPANIES-PRODUCT, COMPANIES-SALES. &lt;/P&gt;&lt;P&gt;  AT END OF NAME. &lt;/P&gt;&lt;P&gt;    SUM. &lt;/P&gt;&lt;P&gt;    WRITE: / COMPANIES-NAME, COMPANIES-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;The AT statements refer to the field COMPANIES-NAME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples &lt;/P&gt;&lt;P&gt;2. AT for the field of an extract dataset &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;1.If the processing you want to perform on an internal table is fairly restricted (i.e. a WHERE addition with the LOOP statement), do not use the AT statements specified in variants 1 to 5, since the interaction of the WHERE addition and the AT statement is currently not defined. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.When you use LOOP with an extract dataset, fields on hex zero are ignored during control level checking with AT NEW or AT END OF . This procedure is the same as the SORT statement. When sorting extracted datasets, this statement always sorts blank fields (i.e. fields on hex zero) regardless of the sequence (ascending or descending) before all fields that contain values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.Since fields addressed with AT are not set to an initial value when you enter a LOOP, the first new group of (table) lines in AT NEW f may not be processed, if f happens to be set to this value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anil Madhavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2007 02:55:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-events/m-p/2333661#M513723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-14T02:55:04Z</dc:date>
    </item>
  </channel>
</rss>

