<?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 select in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725215#M316271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI carl son,&lt;/P&gt;&lt;P&gt;Refer this link :&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db996135c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/9f/db996135c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Oct 2006 15:42:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-30T15:42:29Z</dc:date>
    <item>
      <title>Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725209#M316265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dynamic select like:&lt;/P&gt;&lt;P&gt;data: where_tab(50) occurs 0.&lt;/P&gt;&lt;P&gt;tables mara.&lt;/P&gt;&lt;P&gt;ranges s_matnr for mara-matnr&lt;/P&gt;&lt;P&gt;where_tab = 'matnr in s_matnr'.&lt;/P&gt;&lt;P&gt;select single * from mara where (where_tab).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and i get a dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can i make a dynamic selection with the IN operator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2006 15:21:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725209#M316265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-30T15:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725210#M316266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, you cannot  use the IN operator in a dynamic WHERE clause, at least not in 46c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your only option would be do create the select statement in a generated subroutine and pass the range to this.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2006 15:25:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725210#M316266</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-30T15:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725211#M316267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can not in 5.0, either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2006 15:26:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725211#M316267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-30T15:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725212#M316268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Carlson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this way ..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
concatenate ''' 's_matnr' ''' into str1.
condense str1 no-gaps.
 concatenate 'matnr in '     str1                
             into where_tab  separated by space.  


select single * from mara where (where_tab).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2006 15:28:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725212#M316268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-30T15:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725213#M316269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don´t understand the solution Rich, can you explain me a bit please what is your solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance &lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2006 15:30:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725213#M316269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-30T15:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725214#M316270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is what I mean by a generated subroutine.  You can see how you can build your select statement at runtime.&lt;/P&gt;&lt;P&gt;In this program, it is statically defined, but you can maniuplate the source as you need to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001
       no standard page heading.


types: t_source(72).

data: routine(32) value 'TEMP_ROUTINE',
      program(8),
      message(128),
      line type i.

data: isource type table of t_source,
            xsource type t_source.

data: imara type table of mara with header line.
ranges: r_matnr for imara-matnr.

start-of-selection.

  r_matnr-sign = 'I'.
  r_matnr-option = 'BT'.
  r_matnr-low = '000000000040000100'.
  r_matnr-high = '000000000040000200'.
  append r_matnr.

  perform build_select_statement.




  generate subroutine pool isource name program
                           message message
                           line line.
  if sy-subrc = 0.
    perform (routine) in program (program) tables r_matnr imara.
  else.
    write:/ message.
  endif.

  loop at imara.
    write:/ imara-matnr.
  endloop.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  build_select_statement
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form build_select_statement.


  xsource = 'REPORT ZTEMP_REPORT.'.
  append xsource  to isource.

  concatenate 'FORM' routine
            'tables xr_matnr ximara .'
            into xsource separated by space.
  append xsource  to isource.

  xsource = 'select * into table ximara from mara'.
  append xsource  to isource.

  xsource = 'where matnr in xr_matnr.'.
  append xsource  to isource.

  xsource = 'ENDFORM.'.
  append xsource to isource.

endform.                    " build_select_statement


&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2006 15:40:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725214#M316270</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-30T15:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725215#M316271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI carl son,&lt;/P&gt;&lt;P&gt;Refer this link :&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db996135c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/9f/db996135c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2006 15:42:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1725215#M316271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-30T15:42:29Z</dc:date>
    </item>
  </channel>
</rss>

