<?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: Control Break statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1937664#M387633</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yogesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To my knowledge, in case of classes and methods, OOPs ABAP, only AT NEW control break statement works. Pls note that ON CHANGE OF is not applicable in case of classes/methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jaydeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 18 Feb 2007 13:27:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-18T13:27:49Z</dc:date>
    <item>
      <title>Control Break statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1937663#M387632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I need control break statement apart from AT NEW F and ON CHANGE OF.&lt;/P&gt;&lt;P&gt;Please look below scenario.&lt;/P&gt;&lt;P&gt;I am working on Class Methods. In methods I am using control break statement as&lt;/P&gt;&lt;P&gt;at new f1. But for some cases at new f is not applicable and also on change of is not supported. Please look in the following scenario.&lt;/P&gt;&lt;P&gt; let's say f1 f2 f3 f4 are 4 fields with some values as below.&lt;/P&gt;&lt;P&gt;say structure s1&lt;/P&gt;&lt;P&gt;  f1     f2      f3     f4&lt;/P&gt;&lt;P&gt;  100  200   300  400&lt;/P&gt;&lt;P&gt;  100  200   300  400&lt;/P&gt;&lt;P&gt;  100  200   300  500&lt;/P&gt;&lt;P&gt;  100  200   300  500&lt;/P&gt;&lt;P&gt;So the logic required is if f4 value for several records is same then then we have to group those records as one order. So in above case there will be two orders.&lt;/P&gt;&lt;P&gt;for f4 400 value rest f1 f2 f3 values are also same for two records so at new f4 is applicable.&lt;/P&gt;&lt;P&gt;But what if the condition is as below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   f1     f2      f3     f4&lt;/P&gt;&lt;P&gt;r1 100  200   300  400&lt;/P&gt;&lt;P&gt;r2 100  200   400  400&lt;/P&gt;&lt;P&gt;r3 100  200   500  500&lt;/P&gt;&lt;P&gt;r4 100  200   600  500&lt;/P&gt;&lt;P&gt;though f3 is differrent as 300 and 400 for two records I have to group this as same record for one order as f4 is same 400 for r1 and r2. What can I do to group above records for two orders as earlier condition.&lt;/P&gt;&lt;P&gt;One solution I tried to adjust structures for these two differrent conditions as interchanging f3 and f4 into differrent strucure as s2 . and then moving-corresponding  from s1 to s2  by applying loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say structure s2.&lt;/P&gt;&lt;P&gt;     f1     f2      f4     f3&lt;/P&gt;&lt;P&gt;r1 100  200   400  300  &lt;/P&gt;&lt;P&gt;r2 100  200   400  400&lt;/P&gt;&lt;P&gt;r3 100  200   500  500&lt;/P&gt;&lt;P&gt;r4 100  200   500  600&lt;/P&gt;&lt;P&gt;loop at s1.&lt;/P&gt;&lt;P&gt;move-corresponding s1 to s2.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then applying logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW F4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it's working but I doubt it may be performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if thee is another alternative control break statements apart from AT NEW F4 and  ON CHANGE OF to manage this situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Yogesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Feb 2007 11:27:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1937663#M387632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-17T11:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Control Break statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1937664#M387633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yogesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To my knowledge, in case of classes and methods, OOPs ABAP, only AT NEW control break statement works. Pls note that ON CHANGE OF is not applicable in case of classes/methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jaydeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Feb 2007 13:27:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1937664#M387633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-18T13:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Control Break statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1937665#M387634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yogesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this scenario I usually use the following control break logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
  ls_s2          TYPE &amp;lt;structure s2&amp;gt;,
  ls_s2_x      TYPE &amp;lt;structure s2&amp;gt;,
  ls_s2_old    TYPE &amp;lt;structure s2&amp;gt;,
  lt_itab_x     TYPE STANDARD TABLE of &amp;lt;structure s2&amp;gt;.


SORT lt_itab BY f4.

CLEAR ls_s2_old.
LOOP AT lt_itab INTO ls_s2.

  IF ( ls_s2-f4 ne ls_s2_old-f4 ).
*    ... do processing

*   If you need to collect all records with the same value for field f4 proceed as following:
    REFRESH: lt_itab_x.
    LOOP AT lt_itab INTO ls_s2_x
                             WHERE ( f4 = ls_s2-f4 ).
      APPEND ls_s2_x TO lt_itab_x.
    ENDLOOP.
*  ... do processing
  ENDIF.

ls_s2_old = ls_s2.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Feb 2007 16:29:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/control-break-statements/m-p/1937665#M387634</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-02-18T16:29:40Z</dc:date>
    </item>
  </channel>
</rss>

