<?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: Selection Screen Parameters in SQL statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-parameters-in-sql-statements/m-p/1065697#M93180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you use parameters and no value is entered, it is treated as initial value. and the select statement looks for the initial values for those fields in the tabl;e...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can make the parameters mandatory..then the user would be forced to enter something....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also you could do the following..&lt;/P&gt;&lt;P&gt;instead of parameters, use select-options with the addition no intervals and no extension, then practically it looks like a parameter but internally it is a select-option...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in the select statement, give conditions like....field1 in &amp;lt;s_option name&amp;gt;....in this case if the user is not entering a value ...it is treated as *...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Renjith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Dec 2005 12:46:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-15T12:46:52Z</dc:date>
    <item>
      <title>Selection Screen Parameters in SQL statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-parameters-in-sql-statements/m-p/1065695#M93178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very new ABAP programmer here, so sorry if this is a really dumb question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use my selection screen parameters to limit what is pulled in by my SQL statement (which seems to me to be a very logical thing to do).  But I'm having a problem, that when no values are entered in the parameters, no data is returned in the table instead of all the data being returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code I have now:&lt;/P&gt;&lt;P&gt;  SELECT c&lt;SUB&gt;name1 a&lt;/SUB&gt;kostl a&lt;SUB&gt;orgeh a&lt;/SUB&gt;sname a&lt;SUB&gt;pernr b&lt;/SUB&gt;begda b&lt;SUB&gt;endda b&lt;/SUB&gt;statu&lt;/P&gt;&lt;P&gt;         b&lt;SUB&gt;confl b&lt;/SUB&gt;medcf b&lt;SUB&gt;reasn b&lt;/SUB&gt;reman b~rqday&lt;/P&gt;&lt;P&gt;  INTO CORRESPONDING FIELDS OF TABLE it_record&lt;/P&gt;&lt;P&gt;   FROM ( ( pa0001 AS a&lt;/P&gt;&lt;P&gt;      INNER JOIN pa0672 AS b ON b&lt;SUB&gt;pernr = a&lt;/SUB&gt;pernr )&lt;/P&gt;&lt;P&gt;      INNER JOIN t500p AS c ON c&lt;SUB&gt;persa = a&lt;/SUB&gt;werks )&lt;/P&gt;&lt;P&gt;  WHERE  b~reman in so_reman&lt;/P&gt;&lt;P&gt;    AND a~kostl  in so_kostl&lt;/P&gt;&lt;P&gt;    AND a~orgeh = p_orgeh&lt;/P&gt;&lt;P&gt;    AND b~begda = p_begda&lt;/P&gt;&lt;P&gt;    AND b~statu = p_statu&lt;/P&gt;&lt;P&gt;    AND b~confl = p_confl&lt;/P&gt;&lt;P&gt;    AND b~medcf = p_medcf&lt;/P&gt;&lt;P&gt;    AND b~reasn = p_reasn&lt;/P&gt;&lt;P&gt;    AND b~rqday = p_rqday&lt;/P&gt;&lt;P&gt;    AND c~name1 = p_name1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me what I'd need to do to make it return properly?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2005 12:40:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-parameters-in-sql-statements/m-p/1065695#M93178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-15T12:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Parameters in SQL statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-parameters-in-sql-statements/m-p/1065696#M93179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are declaring the selection screen fields as parameters it will behave this. If you want all values to be returned, declare them as select-options with no interval and no extension. This will be a single field in selection screen and will return all the values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2005 12:45:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-parameters-in-sql-statements/m-p/1065696#M93179</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-15T12:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Parameters in SQL statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-parameters-in-sql-statements/m-p/1065697#M93180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you use parameters and no value is entered, it is treated as initial value. and the select statement looks for the initial values for those fields in the tabl;e...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can make the parameters mandatory..then the user would be forced to enter something....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also you could do the following..&lt;/P&gt;&lt;P&gt;instead of parameters, use select-options with the addition no intervals and no extension, then practically it looks like a parameter but internally it is a select-option...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in the select statement, give conditions like....field1 in &amp;lt;s_option name&amp;gt;....in this case if the user is not entering a value ...it is treated as *...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Renjith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2005 12:46:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-parameters-in-sql-statements/m-p/1065697#M93180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-15T12:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen Parameters in SQL statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-parameters-in-sql-statements/m-p/1065698#M93181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vanda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parameters are used to equate. So if the condition is matched then only you will get the matching record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whereas, if you use select-options for the same, and code as field in s_field, then if u dont enter anything, you will get all the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope its clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2005 12:47:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-parameters-in-sql-statements/m-p/1065698#M93181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-15T12:47:36Z</dc:date>
    </item>
  </channel>
</rss>

