<?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: Using &amp;quot;IN&amp;quot; Statement in LOOP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163404#M457840</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  z_82235_test4                           .

data: gt_mara type table of mara,
      wa_mara like line of gt_mara.

RANGES: r_matnr FOR mara_matnr.


 r_matnr-SIGN = 'I'.
 r_matnr-OPTION = 'EQ'.
 r_matnr-LOW = '1'.
 r_matnr-HIGH = '1000'.


 select * from mara into table gt_mara up to 10 rows.


 LOOP AT gt_mara INTO wa_mara WHERE matnr in r_matnr.
     WRITE: wa_mara-matnr.
     clear: wa_mara.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 May 2007 08:44:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-07T08:44:34Z</dc:date>
    <item>
      <title>Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163395#M457831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to do the below statement, i hit an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP T_GLT0 WHERE RACCT IN ( '0001234567' , '0001233333' ) AND&lt;/P&gt;&lt;P&gt;                                   BUKRS = S_BURKS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this in LOOP statement I can't use "IN". If no, what is the alternate way to write this similiar statement ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:33:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163395#M457831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163396#M457832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP at T_GLT0 WHERE RACCT IN ( '0001234567' , '0001233333' ) AND&lt;/P&gt;&lt;P&gt;BUKRS = S_BURKS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:36:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163396#M457832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163397#M457833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP T_GLT0 WHERE  BUKRS = S_BURKS.&lt;/P&gt;&lt;P&gt;                           and (RACCT = '0001234567' &lt;/P&gt;&lt;P&gt;                               or  RAACT =  '0001233333').&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:36:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163397#M457833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163398#M457834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Move these values '0001234567' , '0001233333'  into a range and you can use that with IN statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP T_GLT0 WHERE RACCT IN r_racct AND BUKRS = S_BURKS.&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;In the Loop use if conditions for Racct and Bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:37:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163398#M457834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163399#M457835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a loop command this is not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at T_GLT0 where BUKRS = S_BURKS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check RACCT IN ( '0001234567' , '0001233333' ).&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpfull.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:38:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163399#M457835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163400#M457836</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;The In keyword inside the loop will work with Ranges. You declare a range and fill the two values in the range and use in the LOOP. Alternatively you can use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP T_GLT0 WHERE  ( RACCT EQ '0001234567'  or RACCT EQ  '0001233333' ) AND BUKRS = S_BURKS.&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;Note : if SBUKRS is not a parameter then you have to use IN S_BUKRS instead of EQ SBUKRS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:38:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163400#M457836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163401#M457837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP T_GLT0 WHERE  ( RACCT &amp;gt; 0001234567 ) and ( RACCT &amp;lt;'0001233333 ) ANDBUKRS = S_BURKS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards ,&lt;/P&gt;&lt;P&gt;Sooness.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:40:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163401#M457837</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-05-07T08:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163402#M457838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP T_GLT0 WHERE ( RACCT &amp;lt; 0001234567 ) and ( RACCT &amp;gt; '0001233333 ) ANDBUKRS = S_BURKS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:41:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163402#M457838</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-05-07T08:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163403#M457839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hong, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use IN operator for select options and ranges.  you can not use in loop where clause.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can achieve by create internaal table with all values in the given range by incrementing the value.  Write nested loop for every racct. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do &lt;/P&gt;&lt;P&gt;increment racct starting from '0001234567'&lt;/P&gt;&lt;P&gt;and update it_racct. &lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;loop at it_racct. &lt;/P&gt;&lt;P&gt;  loop at t_glto where racct it_racct-racct. &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;Thanks &lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:42:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163403#M457839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163404#M457840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  z_82235_test4                           .

data: gt_mara type table of mara,
      wa_mara like line of gt_mara.

RANGES: r_matnr FOR mara_matnr.


 r_matnr-SIGN = 'I'.
 r_matnr-OPTION = 'EQ'.
 r_matnr-LOW = '1'.
 r_matnr-HIGH = '1000'.


 select * from mara into table gt_mara up to 10 rows.


 LOOP AT gt_mara INTO wa_mara WHERE matnr in r_matnr.
     WRITE: wa_mara-matnr.
     clear: wa_mara.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:44:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163404#M457840</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163405#M457841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hong Ming Tan,&lt;/P&gt;&lt;P&gt;                          U can use ranges to do so.&lt;/P&gt;&lt;P&gt;put these two value in range table R_RACCT.&lt;/P&gt;&lt;P&gt;refer this code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**-- Initialization of ranges&lt;/P&gt;&lt;P&gt;R_RACCT-SIGN = 'I'.&lt;/P&gt;&lt;P&gt;R_RACCT-OPTION = 'EQ'.&lt;/P&gt;&lt;P&gt;R_RACCT-LOW = '0001234567'.&lt;/P&gt;&lt;P&gt;APPEND R_RACCT.&lt;/P&gt;&lt;P&gt;CLEAR R_RACCT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R_RACCT-SIGN = 'I'.&lt;/P&gt;&lt;P&gt;R_RACCT-OPTION = 'EQ'.&lt;/P&gt;&lt;P&gt;R_RACCT-LOW = '0001233333'.&lt;/P&gt;&lt;P&gt;APPEND R_RACCT.&lt;/P&gt;&lt;P&gt;CLEAR R_RACCT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at glt0 whrere bukrs = s_bukrs and racct in R_RACCT.&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;&lt;/P&gt;&lt;P&gt;Reward points if helpful.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:48:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163405#M457841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using "IN" Statement in LOOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163406#M457842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ranges : r_racct for &amp;lt;tablename&amp;gt;-racct.&lt;/P&gt;&lt;P&gt;*declare the tablename in which racct field is found&lt;/P&gt;&lt;P&gt;r_racct-sign = 'I'.&lt;/P&gt;&lt;P&gt;r_racct-option = 'EQ'.&lt;/P&gt;&lt;P&gt;r_racct-low =  '0001234567'.&lt;/P&gt;&lt;P&gt;r_racct-high = ''.&lt;/P&gt;&lt;P&gt;append r_racct.&lt;/P&gt;&lt;P&gt;clear r_racct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r_racct-sign = 'I'.&lt;/P&gt;&lt;P&gt;r_racct-option = 'EQ'.&lt;/P&gt;&lt;P&gt;r_racct-low =  '0001233333'.&lt;/P&gt;&lt;P&gt;r_racct-high = ''.&lt;/P&gt;&lt;P&gt;append r_racct.&lt;/P&gt;&lt;P&gt;clear r_racct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop  at t_glto&lt;/P&gt;&lt;P&gt; where  racct in r_racct AND&lt;/P&gt;&lt;P&gt;            burks in s_burks. &lt;/P&gt;&lt;P&gt;          &lt;/P&gt;&lt;P&gt;            &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if burks u have declared in select option.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if s_burks is declared under parameter then use burks = s_burks.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if useful reward with points .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2007 08:53:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-quot-in-quot-statement-in-loop/m-p/2163406#M457842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-07T08:53:20Z</dc:date>
    </item>
  </channel>
</rss>

