<?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: Dynamic Where Clause in a Loop ?? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267257#M149404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the answers yet. &lt;/P&gt;&lt;P&gt;but I think only the answer of Naimesh Patel could be useful, i'm just checking, because there seems to be a difference between an dynamic where-clause in a select and a loop statement.&lt;/P&gt;&lt;P&gt;Samir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Apr 2006 09:11:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-13T09:11:17Z</dc:date>
    <item>
      <title>Dynamic Where Clause in a Loop ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267253#M149400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need a dynamich where-clause in a Loop-Statement, like this:&lt;/P&gt;&lt;P&gt;LOOP AT gt_outtab INTO gs_outtab&lt;/P&gt;&lt;P&gt;  WHERE ( delta IS INITIAL AND &amp;lt;f_per&amp;gt; IS INITIAL ).&lt;/P&gt;&lt;P&gt;    gs_outtab-delta = gs_outtab-per01.&lt;/P&gt;&lt;P&gt;    MODIFY gt_outtab FROM gs_outtab.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;First I tried this:&lt;/P&gt;&lt;P&gt;LOOP AT gt_outtab INTO gs_outtab&lt;/P&gt;&lt;P&gt;  WHERE ( delta IS INITIAL AND (ls_per) IS INITIAL ).&lt;/P&gt;&lt;P&gt;    gs_outtab-delta = gs_outtab-per01.&lt;/P&gt;&lt;P&gt;    MODIFY gt_outtab FROM gs_outtab.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;but with both I get a syntax error.&lt;/P&gt;&lt;P&gt;Do you have an idea, how can I use the component I need dynamically?&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;Samir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 08:38:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267253#M149400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T08:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in a Loop ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267254#M149401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;take  refrence from given link...&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1471449"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 08:52:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267254#M149401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T08:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in a Loop ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267255#M149402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Samir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can not specify the dynamic where clause in Loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF you want to achieve for you logic,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT gt_outtab INTO gs_outtab&lt;/P&gt;&lt;P&gt;WHERE delta IS INITIAL.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; assign f_per to &amp;lt;f_per&amp;gt;.&lt;/P&gt;&lt;P&gt;if f_per is initial.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;gs_outtab-delta = gs_outtab-per01.&lt;/P&gt;&lt;P&gt;MODIFY gt_outtab FROM gs_outtab.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 08:56:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267255#M149402</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2006-04-13T08:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in a Loop ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267256#M149403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;GOOD&lt;/P&gt;&lt;P&gt;Dynamic Conditions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To specify a condition dynamically, use: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ... WHERE (&amp;lt;itab&amp;gt;) ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;itab&amp;gt; is an internal table with line type C and maximum length 72 characters. All of the conditions listed above except for selection tables, can be written into the lines of &amp;lt;itab&amp;gt;. However, you may only use literals, and not the names of data objects. The internal table can also be left empty. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you only want to specify a part of the condition dynamically, use: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ... WHERE &amp;lt;cond&amp;gt; AND (&amp;lt;itab&amp;gt;) ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot link a static and a dynamic condition using OR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may only use dynamic conditions in the WHERE clause of the SELECT statement.&lt;/P&gt;&lt;P&gt;===============================&lt;/P&gt;&lt;P&gt;DATA: TAB_SPFLI   TYPE TABLE OF SPFLI,&lt;/P&gt;&lt;P&gt;      TAB_SFLIGHT TYPE SORTED TABLE OF SFLIGHT&lt;/P&gt;&lt;P&gt;                       WITH UNIQUE KEY TABLE LINE,&lt;/P&gt;&lt;P&gt;      WA LIKE LINE OF TAB_SFLIGHT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT CARRID CONNID&lt;/P&gt;&lt;P&gt;INTO   CORRESPONDING FIELDS OF TABLE TAB_SPFLI&lt;/P&gt;&lt;P&gt;FROM   SPFLI&lt;/P&gt;&lt;P&gt;WHERE  CITYFROM  = 'NEW YORK'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT CARRID CONNID FLDATE&lt;/P&gt;&lt;P&gt;INTO   CORRESPONDING FIELDS OF TABLE TAB_SFLIGHT&lt;/P&gt;&lt;P&gt;FROM   SFLIGHT&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN TAB_SPFLI&lt;/P&gt;&lt;P&gt;WHERE  CARRID = TAB_SPFLI-CARRID AND&lt;/P&gt;&lt;P&gt;       CONNID = TAB_SPFLI-CONNID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB_SFLIGHT INTO WA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  AT NEW CONNID.&lt;/P&gt;&lt;P&gt;    WRITE: / WA-CARRID, WA-CONNID.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / WA-FLDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS&lt;/P&gt;&lt;P&gt;MRUTYUN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 08:57:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267256#M149403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T08:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Where Clause in a Loop ??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267257#M149404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the answers yet. &lt;/P&gt;&lt;P&gt;but I think only the answer of Naimesh Patel could be useful, i'm just checking, because there seems to be a difference between an dynamic where-clause in a select and a loop statement.&lt;/P&gt;&lt;P&gt;Samir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2006 09:11:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-where-clause-in-a-loop/m-p/1267257#M149404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-13T09:11:17Z</dc:date>
    </item>
  </channel>
</rss>

