<?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: select options and loop statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070826#M1504617</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Gengis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the scenario where i need to restrict the loop from the select-options.&lt;/P&gt;&lt;P&gt;in the select-options, user enter currency.&lt;/P&gt;&lt;P&gt;then in the loop i need to loop base on the currency user enter.&lt;/P&gt;&lt;P&gt;may i know what steps should i use for the loop as loop cannot support where.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as per your requirement.&lt;/P&gt;&lt;P&gt;you have some data in your internal table also you have a select-options to input values.&lt;/P&gt;&lt;P&gt;on the basis of the values in your select option you want to fetch the values from your internal table. right???&lt;/P&gt;&lt;P&gt;then there should be a field like your select option in your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select-option: s_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let assume you have an internal table with matnr and other fields also and your select-options is for mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you need to select the values in your internal table according to the values in your select-options like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT MATNR field1 field2........ from dbtable into table itab where matnr = s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above code will give you the values matching the values in your select-options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need not to apply loop becasue you already have only those values for which yo u have found records in the DBTABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in case you want to apply loop on an internal table on the basis of s_matnr's values, then you can write.&lt;/P&gt;&lt;P&gt;in this scenario you need to define 2 internal table one with already fethced values and another in which we will fetch the values according to select-options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt;read table itab1 into wa_itab1 where matnr = wa_itab-matnr.&lt;/P&gt;&lt;P&gt;write statement........&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before that youwill have to fetch values in itab according to s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will clear your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Lalit Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jul 2010 09:21:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-08T09:21:05Z</dc:date>
    <item>
      <title>select options and loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070825#M1504616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear forum,&lt;/P&gt;&lt;P&gt;I have the scenario where i need to restrict the loop from the select-options.&lt;/P&gt;&lt;P&gt;in the select-options, user enter currency.&lt;/P&gt;&lt;P&gt;then in the loop i need to loop base on the currency user enter.&lt;/P&gt;&lt;P&gt;may i know what steps should i use for the loop as loop cannot support where.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 08:41:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070825#M1504616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-08T08:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: select options and loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070826#M1504617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Gengis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the scenario where i need to restrict the loop from the select-options.&lt;/P&gt;&lt;P&gt;in the select-options, user enter currency.&lt;/P&gt;&lt;P&gt;then in the loop i need to loop base on the currency user enter.&lt;/P&gt;&lt;P&gt;may i know what steps should i use for the loop as loop cannot support where.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as per your requirement.&lt;/P&gt;&lt;P&gt;you have some data in your internal table also you have a select-options to input values.&lt;/P&gt;&lt;P&gt;on the basis of the values in your select option you want to fetch the values from your internal table. right???&lt;/P&gt;&lt;P&gt;then there should be a field like your select option in your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select-option: s_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let assume you have an internal table with matnr and other fields also and your select-options is for mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you need to select the values in your internal table according to the values in your select-options like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT MATNR field1 field2........ from dbtable into table itab where matnr = s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above code will give you the values matching the values in your select-options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need not to apply loop becasue you already have only those values for which yo u have found records in the DBTABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in case you want to apply loop on an internal table on the basis of s_matnr's values, then you can write.&lt;/P&gt;&lt;P&gt;in this scenario you need to define 2 internal table one with already fethced values and another in which we will fetch the values according to select-options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt;read table itab1 into wa_itab1 where matnr = wa_itab-matnr.&lt;/P&gt;&lt;P&gt;write statement........&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before that youwill have to fetch values in itab according to s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will clear your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Lalit Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 09:21:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070826#M1504617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-08T09:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: select options and loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070827#M1504618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gengis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly please be informed that LOOP does support where condition.&lt;/P&gt;&lt;P&gt;Lets say your a) internal table is it_tab, &lt;/P&gt;&lt;P&gt;                       b) work area is wa_tab and&lt;/P&gt;&lt;P&gt;                       c) select option is s_currency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and Currency is a field in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax would be:&lt;/P&gt;&lt;P&gt;Loop at it_tab into wa_tab where currency in s_currency[].&lt;/P&gt;&lt;P&gt;XXXX&lt;/P&gt;&lt;P&gt;YYYYYY&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhijeet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 09:26:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070827#M1504618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-08T09:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: select options and loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070828#M1504619</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;With loop where condition apply....!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See abap documentation for help for the condition with loop...!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Fawad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 09:29:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070828#M1504619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-08T09:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: select options and loop statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070829#M1504620</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;You can do in the below way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  option 1 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        loop at you select -option as it is internal table with header line you can loop it and then&lt;/P&gt;&lt;P&gt;  read your internal table in which you have values.&lt;/P&gt;&lt;P&gt; ie &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   loop at select-option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  read table itab ino wa_itab with key feild = select-option &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0 .&lt;/P&gt;&lt;P&gt;   do your required processing.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;option 2 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop your itab with where condition on select-option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you need further information&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Satish Boguda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 09:45:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options-and-loop-statement/m-p/7070829#M1504620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-08T09:45:45Z</dc:date>
    </item>
  </channel>
</rss>

