<?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 at with where statement why not possible in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856517#M47278</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandhya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have not closed your &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="37861"&gt;&lt;/A&gt;. I hope that issue is not succesfully resolved. Can you please mark that thread as answered?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming to your current problem, in the first case, you seem to have forgotten to put the quotes around DO. Remember,  'DO' is a literal where as DO will be a variable. If this is not the cause for the error, please get back...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 May 2005 05:08:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-05-06T05:08:13Z</dc:date>
    <item>
      <title>loop at with where statement why not possible</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856513#M47274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is part of the code for the BADI.&lt;/P&gt;&lt;P&gt;When I use the below code I get the error "in Loop..Where the line type should be statically defined"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Code:&lt;/P&gt;&lt;P&gt;method IF_EX_OPENHUB_TRANSFORM~TRANSFORM.&lt;/P&gt;&lt;P&gt;  data: l_s_data_in type /BIC/CYZTRX.&lt;/P&gt;&lt;P&gt;  data: l_s_data_out type /BIC/CZZTRX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      clear e_t_data_out.&lt;/P&gt;&lt;P&gt;         loop at i_t_data_in into l_s_data_in&lt;/P&gt;&lt;P&gt;          where /BIC/ZI_MARKET EQ SPACE&lt;/P&gt;&lt;P&gt;                 and SOURSYSTEM EQ DO&lt;/P&gt;&lt;P&gt;                 and /BIC/ZGN_SLDTO NE SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         move-corresponding l_s_data_in to l_s_data_out.&lt;/P&gt;&lt;P&gt;         insert l_s_data_out into table e_t_data_out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         endloop.&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code with no Check error:&lt;/P&gt;&lt;P&gt;method IF_EX_OPENHUB_TRANSFORM~TRANSFORM.&lt;/P&gt;&lt;P&gt;  data: l_s_data_in type /BIC/CYZTRX.&lt;/P&gt;&lt;P&gt;  data: l_s_data_out type /BIC/CZZTRX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      clear e_t_data_out.&lt;/P&gt;&lt;P&gt;         loop at i_t_data_in into l_s_data_in.&lt;/P&gt;&lt;P&gt;            if l_s_data_in-/BIC/ZI_MARKET EQ SPACE&lt;/P&gt;&lt;P&gt;               and l_s_data_in-SOURSYSTEM EQ 'DO'&lt;/P&gt;&lt;P&gt;               and l_s_data_in-/BIC/ZGN_SLDTO NE SPACE.&lt;/P&gt;&lt;P&gt;               move-corresponding l_s_data_in to l_s_data_out.&lt;/P&gt;&lt;P&gt;               insert l_s_data_out into table e_t_data_out.&lt;/P&gt;&lt;P&gt;            else.&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;         endloop.&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use the logic in the Where statment instead of writing it as a seperate IF statement. Wondering if there is any error in the first code. Is there any other method of acheving this. Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thx in adv.&lt;/P&gt;&lt;P&gt;Sandhya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2005 18:26:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856513#M47274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-05T18:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: loop at with where statement why not possible</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856514#M47275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason is that the structure of the internal table I_T_DATA_IN is not known to the BADI, but once transported to the work area I_S_DATA_IN which has a defined structure that the BADI can recognize, the individual structure level checks are possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rishi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2005 18:47:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856514#M47275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-05T18:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: loop at with where statement why not possible</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856515#M47276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sandhya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the rule is; during comparision the field on the left of the '=' should belong to the table(internal). Looking at your code, it doesn't belong to the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kshitij&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2005 18:49:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856515#M47276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-05T18:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: loop at with where statement why not possible</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856516#M47277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would modify your code as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
method IF_EX_OPENHUB_TRANSFORM~TRANSFORM.
  data: l_s_data_in type /BIC/CYZTRX.
  data: l_s_data_out type /BIC/CZZTRX.
  data: l_it_data type /BIC/CYZTRX occurs 0.

  l_it_data[] = i_t_data_in[].
  clear e_t_data_out.
  loop at l_it_data into l_s_data_in
                   where /BIC/ZI_MARKET EQ SPACE
                     and SOURSYSTEM     EQ DO
                     and /BIC/ZGN_SLDTO NE SPACE.
    move-corresponding l_s_data_in to l_s_data_out.
    insert l_s_data_out into table e_t_data_out.
  endloop.
endmethod.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 May 2005 04:15:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856516#M47277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-06T04:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: loop at with where statement why not possible</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856517#M47278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandhya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have not closed your &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="37861"&gt;&lt;/A&gt;. I hope that issue is not succesfully resolved. Can you please mark that thread as answered?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming to your current problem, in the first case, you seem to have forgotten to put the quotes around DO. Remember,  'DO' is a literal where as DO will be a variable. If this is not the cause for the error, please get back...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 May 2005 05:08:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856517#M47278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-06T05:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: loop at with where statement why not possible</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856518#M47279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice catch!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 May 2005 18:17:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-with-where-statement-why-not-possible/m-p/856518#M47279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-06T18:17:32Z</dc:date>
    </item>
  </channel>
</rss>

