<?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 How to improve loop inside loop? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-improve-loop-inside-loop/m-p/12577739#M2009067</link>
    <description>&lt;P&gt;I 'm writng a program. First I query fields WTGXXX and objnr from cosp_bak. Then for each line I search csks with same objnr and filled func_area field.&lt;/P&gt;
  &lt;P&gt;Suppose data in cosp_bak like below:&lt;/P&gt;
  &lt;P&gt;WTG001 WTG002 WTG003 WTG004 WTG005 WTG006 WTG007 WTG008 WTG009 WTG010 WTG011 WTG012&lt;/P&gt;
  &lt;P&gt;3 4 0 0 0 8 0 0 0 0 0 0&lt;/P&gt;
  &lt;P&gt;And in csks there are two lines&lt;/P&gt;
  &lt;P&gt;datab datbi func_area&lt;/P&gt;
  &lt;P&gt;20220101 20220531 FM&lt;/P&gt;
  &lt;P&gt;20220601 20221231 FR&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;The expected result will be two rows as below:&lt;/P&gt;
  &lt;P&gt;WTG001 WTG002 WTG003 WTG004 WTG005 WTG006 WTG007 WTG008 WTG009 WTG010 WTG011 WTG012&lt;/P&gt;
  &lt;P&gt;3 4 0 0 0 0 0 0 0 0 0 0 FM&lt;/P&gt;
  &lt;P&gt;3 4 0 0 0 8 0 0 0 0 0 0 FR&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;I wonder is there a better way to do it since loop inside loop is pretty consuming?Thx.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 10:07:04 GMT</pubDate>
    <dc:creator>former_member625844</dc:creator>
    <dc:date>2022-09-23T10:07:04Z</dc:date>
    <item>
      <title>How to improve loop inside loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-improve-loop-inside-loop/m-p/12577739#M2009067</link>
      <description>&lt;P&gt;I 'm writng a program. First I query fields WTGXXX and objnr from cosp_bak. Then for each line I search csks with same objnr and filled func_area field.&lt;/P&gt;
  &lt;P&gt;Suppose data in cosp_bak like below:&lt;/P&gt;
  &lt;P&gt;WTG001 WTG002 WTG003 WTG004 WTG005 WTG006 WTG007 WTG008 WTG009 WTG010 WTG011 WTG012&lt;/P&gt;
  &lt;P&gt;3 4 0 0 0 8 0 0 0 0 0 0&lt;/P&gt;
  &lt;P&gt;And in csks there are two lines&lt;/P&gt;
  &lt;P&gt;datab datbi func_area&lt;/P&gt;
  &lt;P&gt;20220101 20220531 FM&lt;/P&gt;
  &lt;P&gt;20220601 20221231 FR&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;The expected result will be two rows as below:&lt;/P&gt;
  &lt;P&gt;WTG001 WTG002 WTG003 WTG004 WTG005 WTG006 WTG007 WTG008 WTG009 WTG010 WTG011 WTG012&lt;/P&gt;
  &lt;P&gt;3 4 0 0 0 0 0 0 0 0 0 0 FM&lt;/P&gt;
  &lt;P&gt;3 4 0 0 0 8 0 0 0 0 0 0 FR&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;I wonder is there a better way to do it since loop inside loop is pretty consuming?Thx.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 10:07:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-improve-loop-inside-loop/m-p/12577739#M2009067</guid>
      <dc:creator>former_member625844</dc:creator>
      <dc:date>2022-09-23T10:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to improve loop inside loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-improve-loop-inside-loop/m-p/12577740#M2009068</link>
      <description>&lt;P&gt;Please format better your question to make it legible e.g. as follows&lt;/P&gt;&lt;P&gt;Suppose data in cosp_bak like below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WTG001 WTG002 WTG003 WTG004 WTG005 WTG006 WTG007 WTG008 WTG009 WTG010 WTG011 WTG012
3      4      0      0      0      8      0      0      0      0      0      0&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And in csks there are two lines&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;datab    datbi    func_area
20220101 20220531 FM
20220601 20221231 FR&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The expected result will be two rows as below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WTG001 WTG002 WTG003 WTG004 WTG005 WTG006 WTG007 WTG008 WTG009 WTG010 WTG011 WTG012 func_area
3      4      0      0      0      0      0      0      0      0      0      0      FM
3      4      0      0      0      8      0      0      0      0      0      0      FR&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Sep 2022 10:17:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-improve-loop-inside-loop/m-p/12577740#M2009068</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-09-23T10:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to improve loop inside loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-improve-loop-inside-loop/m-p/12577741#M2009069</link>
      <description>&lt;P&gt;Hi Ricky,&lt;/P&gt;&lt;P&gt;Loop at csks (table having two rows) and read the values from cosp_bak (One row) with key and populate values as required.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prakash.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 12:14:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-improve-loop-inside-loop/m-p/12577741#M2009069</guid>
      <dc:creator>prakashjasti</dc:creator>
      <dc:date>2022-09-23T12:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to improve loop inside loop?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-improve-loop-inside-loop/m-p/12577742#M2009070</link>
      <description>&lt;P&gt;You could use a JOIN between COSP_BACK and CSKS but keep date from/to in the result table as there will be duplicate amounts to resolve: &lt;/P&gt;&lt;P&gt;Work on the result table in a single LOOP, clearing amount not relevant : if one record of CSKS was valid from january to march and another one from april. then clear amounts for april-december in the first record, clear amounts for january-march in the second record, delete any record with no non-null amount.&lt;/P&gt;&lt;P&gt;With your data you should get&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;WTG001 WTG002 WTG003 WTG004 WTG005 WTG006 WTG007 WTG008 WTG009 WTG010 WTG011 WTG012 datab    datbi    func_area
3      4      0      0      0      0      0      0      0      0      0      0      20220101 20220531 FM

0      0      0      0      0      8      0      0      0      0      0      0      20220601 20221231 FR&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Sep 2022 13:31:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-improve-loop-inside-loop/m-p/12577742#M2009070</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2022-09-23T13:31:24Z</dc:date>
    </item>
  </channel>
</rss>

