<?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 statement in ABAP OO in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-statement-in-abap-oo/m-p/998844#M75847</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;Try using this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create a work area to internal table lt_selections.&lt;/P&gt;&lt;P&gt;data: wa_selections like line of lt_selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Change the loop:&lt;/P&gt;&lt;P&gt;Loop at lt_selections into wa_wa_selections.&lt;/P&gt;&lt;P&gt;select logsys from /bic/mzcs_unit where /bic/zcs_unit = wa_selections-cs_unit&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or use FOR ALL ENTRIES statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select logsys from /bic/mzcs_unit &lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN lt_selections&lt;/P&gt;&lt;P&gt;where /bic/zcs_unit = lt_selections-cs_unit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alejandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Oct 2005 20:48:37 GMT</pubDate>
    <dc:creator>alejandro_lpez</dc:creator>
    <dc:date>2005-10-05T20:48:37Z</dc:date>
    <item>
      <title>Loop statement in ABAP OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-statement-in-abap-oo/m-p/998842#M75845</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;I am trying to change a BADI interface and since BADIs use ABAP OO, a simple loop statement fails to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to loop through an internal table and for each record in the internal table I need to read another db table which has a field in common with the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at lt_selections&lt;/P&gt;&lt;P&gt;select logsys from /bic/mzcs_unit where /bic/zcs_unit = lt_selections-cs_unit&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this piece of code fails to work in BADI because of OO concepts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me out here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2005 20:26:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-statement-in-abap-oo/m-p/998842#M75845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-05T20:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Loop statement in ABAP OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-statement-in-abap-oo/m-p/998843#M75846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Deep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually the code below does work. It doesnt depend on OO concept in BADI or other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be there may be a type mis match between the field in the internal table and the key in the db table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2005 20:41:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-statement-in-abap-oo/m-p/998843#M75846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-05T20:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Loop statement in ABAP OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-statement-in-abap-oo/m-p/998844#M75847</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;Try using this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create a work area to internal table lt_selections.&lt;/P&gt;&lt;P&gt;data: wa_selections like line of lt_selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Change the loop:&lt;/P&gt;&lt;P&gt;Loop at lt_selections into wa_wa_selections.&lt;/P&gt;&lt;P&gt;select logsys from /bic/mzcs_unit where /bic/zcs_unit = wa_selections-cs_unit&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or use FOR ALL ENTRIES statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select logsys from /bic/mzcs_unit &lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN lt_selections&lt;/P&gt;&lt;P&gt;where /bic/zcs_unit = lt_selections-cs_unit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alejandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2005 20:48:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-statement-in-abap-oo/m-p/998844#M75847</guid>
      <dc:creator>alejandro_lpez</dc:creator>
      <dc:date>2005-10-05T20:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Loop statement in ABAP OO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-statement-in-abap-oo/m-p/998845#M75848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Alejandro said, if you are getting a syntax error, it is probably because &amp;lt;b&amp;gt;header lines are not allow in OO&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: wa_selections like line of lt_selections.
Loop at lt_selections into wa_wa_selections.
select logsys from /bic/mzcs_unit 
     where /bic/zcs_unit = wa_selections-cs_unit.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2005 21:27:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-statement-in-abap-oo/m-p/998845#M75848</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-10-05T21:27:34Z</dc:date>
    </item>
  </channel>
</rss>

