<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638924#M284710</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Salil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from ur both selcts you are going to get only a single land1.&lt;/P&gt;&lt;P&gt;in ur where condition, u r selecting on select-option so it can contain many records..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so declare IT and get values into IT..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT lifnr&lt;/P&gt;&lt;P&gt;                name1&lt;/P&gt;&lt;P&gt;    FROM lfa1&lt;/P&gt;&lt;P&gt;    INTO table it_lifnr&lt;/P&gt;&lt;P&gt;    WHERE lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Anupama Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Nov 2006 08:34:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-22T08:34:46Z</dc:date>
    <item>
      <title>select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638919#M284705</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;I have one query in select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose I have to select only LAND1 field from LFA1 table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anybody will suggest me what I have to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select land1 from lfa1 into gs_lfa1 where lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or select single land1 from lfa1 into gs_lfa1 where lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz tell me the difference also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 08:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638919#M284705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T08:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638920#M284706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;select lifnr land1 from lfa1 into table gt_lfa1 where lifnr in s_lifnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u  r using select option for lifnr .it means requirment is  u ahve  put more than one  vendor also..collect all the land1 according to given lifnr into a internal table.&lt;/P&gt;&lt;P&gt;and when ever  u need  used  read statment to fetch it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kishan negi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 08:30:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638920#M284706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T08:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638921#M284707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select single is the best one. if u a riffering only on lifnr,&lt;/P&gt;&lt;P&gt;if you use select option ... use select land1 form lfa1 into table it_land1 where lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Naresh Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 08:31:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638921#M284707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T08:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638922#M284708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Salil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want  to select only one record then select single is the better option.&lt;/P&gt;&lt;P&gt;select single land1 from lfa1 into gs_lfa1 where lifnr in s_lifnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 08:32:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638922#M284708</guid>
      <dc:creator>Sandeep_Panghal</dc:creator>
      <dc:date>2006-11-22T08:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638923#M284709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select land1 from lfa1 into gs_lfa1 where lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt; --Since you specify ranges in your WHERE condition. The SELECT query may return one or more records. Hence you must either specify INTO TABLE or use ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single land1 from lfa1 into gs_lfa1 where lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt;  --This will return the first record in the selection condition into the variable gs_lfa1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer ABAP Wiki for more info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Wenceslaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 08:33:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638923#M284709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T08:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638924#M284710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Salil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from ur both selcts you are going to get only a single land1.&lt;/P&gt;&lt;P&gt;in ur where condition, u r selecting on select-option so it can contain many records..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so declare IT and get values into IT..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT lifnr&lt;/P&gt;&lt;P&gt;                name1&lt;/P&gt;&lt;P&gt;    FROM lfa1&lt;/P&gt;&lt;P&gt;    INTO table it_lifnr&lt;/P&gt;&lt;P&gt;    WHERE lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Anupama Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 08:34:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638924#M284710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T08:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638925#M284711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;select land1 from lfa1 into gs_lfa1 where lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this statement retrieves multiple records from lfa1 depending on the range u entereed  in s_lifnr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single land1 from lfa1 into gs_lfa1 where lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this statement selects the first record from the database satisfying the selection criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps,&lt;/P&gt;&lt;P&gt;keerthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 08:38:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638925#M284711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T08:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638926#M284712</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;while debugging i found that it will not picking the record for my selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if i use into corresponding fields in my select query it will work. Is it fine for performance point of view??&lt;/P&gt;&lt;P&gt;suppose i have parameter option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select land1 from lfa1 into corresponding fields of gs_lfa1 where lifnr in p_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it fine??&lt;/P&gt;&lt;P&gt;if any alternative is available then plz let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 09:09:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638926#M284712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T09:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638927#M284713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Avoid using INTO CORRESPONDING...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the type of gs_lfa1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using parameters:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS p_lifnr LIKE lfa1-lifnr.
DATA g_land LIKE &amp;lt;b&amp;gt;lfa1-land1&amp;lt;/b&amp;gt;.
SELECT SINGLE land1 FROM lfa1 INTO g_land WHERE lifnr EQ p_lifnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Wenceslaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Nov 2006 09:39:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1638927#M284713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-22T09:39:16Z</dc:date>
    </item>
  </channel>
</rss>

