<?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: Coding in Badi in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553978#M251091</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, u r right. But already 4 nested loops are going on.. is there any problem if the number increases by 1 or 2. Performance point of view.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Oct 2006 20:01:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-06T20:01:11Z</dc:date>
    <item>
      <title>Coding in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553973#M251086</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;Please see the coding... My requirement is i have to compare Item_text field with all the records in loop. Below condition is satisfying only if two records are there. i.e. it is only containging the first record text. how to overcome this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT lt_item INTO ls_item&lt;/P&gt;&lt;P&gt;IF lv_item_text IS INITIAL&lt;/P&gt;&lt;P&gt;MOVE ls_item-item_text TO lv_item_text.&lt;/P&gt;&lt;P&gt;CONTINUE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ls_item-item_text = lv_item_text.&lt;/P&gt;&lt;P&gt; --- -- &lt;/P&gt;&lt;P&gt;- --- &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 18:30:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553973#M251086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T18:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Coding in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553974#M251087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reddy,&lt;/P&gt;&lt;P&gt;  Your code is only going to compare on the first record because after the first time through your loop the field lv_item_text is no longer initial.  If you want to move ls_item-item_text on every loop, then you need to clear the field lv_item_text just before your ENDLOOP statement.  I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; - April King&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 18:39:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553974#M251087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T18:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Coding in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553975#M251088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See i have to check lv_item_text with all the records in the same loop. after completing this i have go to the second record and move the ls_item-text to lv_item_text and again have to compare all the records in table like this for all the records i have to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 18:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553975#M251088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T18:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Coding in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553976#M251089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I not sure what you exactly want but the below might help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at lv_item into ls_item.&lt;/P&gt;&lt;P&gt;  loop at lv_item into l_item where&lt;/P&gt;&lt;P&gt;     text = lv_item_text.&lt;/P&gt;&lt;P&gt;     *what you wish to do&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 18:56:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553976#M251089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T18:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Coding in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553977#M251090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right.  But you aren't moving ls_item-text to lv_item_text after the first loop because the condition "IF lv_item_text IS INITIAL" is false after the first loop (you've already moved ls_item-text into that field in your first loop). So after you've done your comparisons in the loop you need to clear lv_item_text if you want that field to be initial for the next run through the loop. Is that a little clearer?  Or you can take out the "IF lv_item_text IS INITIAL" condition so that the field will automatically be moved every time through the loop.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or do you mean that you need to compare all of the records in lt_item with lv_item_text (which is from whatever record in lt_item you're currently on)?  Sorry, I'm trying to make sure I'm interpreting your question correctly.  If this is what you mean, then you basically want to do nested loops through the same table.  I don't think you can actually do this.  As long as lt_item isn't too big, I would suggest copying it into another table and changing your code to something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;la_item[] = lt_item[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT la_item INTO lb_item.&lt;/P&gt;&lt;P&gt;MOVE lb_item-item_text TO lv_item_text.&lt;/P&gt;&lt;P&gt;LOOP AT lt_item INTO ls_item &lt;/P&gt;&lt;P&gt;WHERE item_text = lv_item_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--- -- &lt;/P&gt;&lt;P&gt;- --- &lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would just have to make sure that you didn't go into the processing code when you reach the same line in table lt_item as you are currently at in table la_item (check for a matching key if the table has one).&lt;/P&gt;&lt;P&gt; - April&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 19:07:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553977#M251090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T19:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Coding in Badi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553978#M251091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, u r right. But already 4 nested loops are going on.. is there any problem if the number increases by 1 or 2. Performance point of view.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 20:01:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-in-badi/m-p/1553978#M251091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T20:01:11Z</dc:date>
    </item>
  </channel>
</rss>

