<?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 query doubt in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804596#M655260</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;read my above note, another way to do this is to use ranges&lt;/P&gt;&lt;P&gt;define a range (like a select option)&lt;/P&gt;&lt;P&gt;and use IN in the where clause.&lt;/P&gt;&lt;P&gt;if the range is empty. it will act as awild card&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2007 17:59:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-10T17:59:28Z</dc:date>
    <item>
      <title>select query doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804590#M655254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have a situation where in a table has following fields&lt;/P&gt;&lt;P&gt;Id  &lt;/P&gt;&lt;P&gt;username &lt;/P&gt;&lt;P&gt;status &lt;/P&gt;&lt;P&gt;userdetails&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the id, user name, status fields are key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the select query even if I pass a single key(not all three) I should get the user details how can i write the query?&lt;/P&gt;&lt;P&gt;(ie sometimes status will be unique and table will have only a single entry with that status) Do i need to use AND in the where clause  to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * from table where id = id&lt;/P&gt;&lt;P&gt;                                            and username = username&lt;/P&gt;&lt;P&gt;                                            and status = status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my question is if table has an enry id=1000 username = 'anne' status = 'manager'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and is i pass only the status to query it should retrieve the record..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will this query work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 17:44:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804590#M655254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-10T17:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: select query doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804591#M655255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since u have 3 key fields&lt;/P&gt;&lt;P&gt;the table will allow more than one entry with 'manager'.&lt;/P&gt;&lt;P&gt;So if you have more than one entry you might get any one of them in this select.&lt;/P&gt;&lt;P&gt;Use AND if u want 'ANNE' for sure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 17:47:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804591#M655255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-10T17:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: select query doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804592#M655256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nehal,&lt;/P&gt;&lt;P&gt;yes i agree the table will allow more entries...My question is if i pass only status 'manager' to query and leave the other two key fields empty will it retrieve the record?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 17:51:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804592#M655256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-10T17:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: select query doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804593#M655257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;are us saying the where caluse will havwe&lt;/P&gt;&lt;P&gt;and username = space&lt;/P&gt;&lt;P&gt;and id = space?...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then no. it will not return the result&lt;/P&gt;&lt;P&gt;It will look for rows with manager and id and username as space&lt;/P&gt;&lt;P&gt;which it might not find&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 17:55:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804593#M655257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-10T17:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: select query doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804594#M655258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead this is what u do..&lt;/P&gt;&lt;P&gt;use wild cards&lt;/P&gt;&lt;P&gt;replace the = with like in the where section&lt;/P&gt;&lt;P&gt;append ur variable with %var_value%&lt;/P&gt;&lt;P&gt;if there is no value then it should be %%.&lt;/P&gt;&lt;P&gt;This will ´return all with manager&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 17:57:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804594#M655258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-10T17:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: select query doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804595#M655259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then how can I achieve that...?In some case i will be passing all the keys and in some case i will apss only status...Is it possible to achieve that with a single query...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;larry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 17:58:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804595#M655259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-10T17:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: select query doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804596#M655260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;read my above note, another way to do this is to use ranges&lt;/P&gt;&lt;P&gt;define a range (like a select option)&lt;/P&gt;&lt;P&gt;and use IN in the where clause.&lt;/P&gt;&lt;P&gt;if the range is empty. it will act as awild card&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 17:59:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804596#M655260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-10T17:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: select query doubt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804597#M655261</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;Try to using the below code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report ZXxx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables -&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;	id like tablename-field,&lt;/P&gt;&lt;P&gt;	user like tablename-field,&lt;/P&gt;&lt;P&gt;	status like tablename-field,&lt;/P&gt;&lt;P&gt;          end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;PARAMETERS   :   sp_id like table-field&lt;/P&gt;&lt;P&gt;                           sp_user LIKE table-user,&lt;/P&gt;&lt;P&gt;                           sp_status LIKE table-status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select  * from &amp;lt;table&amp;gt; into table itab where id = sp_id&lt;/P&gt;&lt;P&gt;			         and    user = sp_user&lt;/P&gt;&lt;P&gt;                                                         and status = sp_status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sri:-)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 18:00:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-doubt/m-p/2804597#M655261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-10T18:00:13Z</dc:date>
    </item>
  </channel>
</rss>

