<?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: Problem with ENDSELECT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523849#M847591</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;if u use INTO CORREESPONDING FIELDS OF TABLE itab u can avoid the endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Mar 2008 10:10:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-10T10:10:58Z</dc:date>
    <item>
      <title>Problem with ENDSELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523847#M847589</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;Is it possible not to put an Endselect to the below 2 examples. Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.   SELECT matnr&lt;/P&gt;&lt;P&gt;               werks&lt;/P&gt;&lt;P&gt;               lgort&lt;/P&gt;&lt;P&gt;               labst&lt;/P&gt;&lt;P&gt;               FROM mard INTO i_mard&lt;/P&gt;&lt;P&gt;               FOR ALL ENTRIES IN i_stpo&lt;/P&gt;&lt;P&gt;               WHERE matnr = i_stpo-idnrk&lt;/P&gt;&lt;P&gt;                 AND werks = i_stpo-pswrk&lt;/P&gt;&lt;P&gt;                 AND lgort = i_stpo-lgort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.    SELECT stko~bmeng&lt;/P&gt;&lt;P&gt;           stpo~idnrk&lt;/P&gt;&lt;P&gt;           stpo~menge&lt;/P&gt;&lt;P&gt;           stpo~lgort&lt;/P&gt;&lt;P&gt;           FROM stko INNER JOIN stpo&lt;/P&gt;&lt;P&gt;           ON stko&lt;SUB&gt;stlnr = stpo&lt;/SUB&gt;stlnr&lt;/P&gt;&lt;P&gt;           INTO i_stpo&lt;/P&gt;&lt;P&gt;           WHERE stko~stlnr = v_stlnr&lt;/P&gt;&lt;P&gt;             AND stpo~pswrk = p_werks&lt;/P&gt;&lt;P&gt;             AND stpo~stlnr = c_1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 10:07:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523847#M847589</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T10:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with ENDSELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523848#M847590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in 1) u cant write endselect but for 2) u hav to&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 10:10:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523848#M847590</guid>
      <dc:creator>former_member188827</dc:creator>
      <dc:date>2008-03-10T10:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with ENDSELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523849#M847591</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;if u use INTO CORREESPONDING FIELDS OF TABLE itab u can avoid the endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 10:10:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523849#M847591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T10:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with ENDSELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523850#M847592</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;For First its perfectly ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For second you may try out and see...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dhruv Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 10:12:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523850#M847592</guid>
      <dc:creator>dhruv_shah3</dc:creator>
      <dc:date>2008-03-10T10:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with ENDSELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523851#M847593</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;In the first statement there is no need for an ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the second one you need to have ENDSELECT.  You can avoid this , if you put SELECT SINGLE, but this will fetch only one record for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just check which one is appropriate for your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&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, 10 Mar 2008 10:14:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523851#M847593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T10:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with ENDSELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523852#M847594</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;&lt;/P&gt;&lt;P&gt;IF NOT  i_stpo[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT matnr&lt;/P&gt;&lt;P&gt;werks&lt;/P&gt;&lt;P&gt;lgort&lt;/P&gt;&lt;P&gt;labst&lt;/P&gt;&lt;P&gt;FROM mard INTO &lt;STRONG&gt;TABLE&lt;/STRONG&gt; i_mard&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN i_stpo&lt;/P&gt;&lt;P&gt;WHERE matnr = i_stpo-idnrk&lt;/P&gt;&lt;P&gt;AND werks = i_stpo-pswrk&lt;/P&gt;&lt;P&gt;AND lgort = i_stpo-lgort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. SELECT stko~bmeng&lt;/P&gt;&lt;P&gt;stpo~idnrk&lt;/P&gt;&lt;P&gt;stpo~menge&lt;/P&gt;&lt;P&gt;stpo~lgort&lt;/P&gt;&lt;P&gt;FROM stko INNER JOIN stpo&lt;/P&gt;&lt;P&gt;ON stko&lt;SUB&gt;stlnr = stpo&lt;/SUB&gt;stlnr&lt;/P&gt;&lt;P&gt;INTO *TABLE * i_stpo&lt;/P&gt;&lt;P&gt;WHERE stko~stlnr = v_stlnr&lt;/P&gt;&lt;P&gt;AND stpo~pswrk = p_werks&lt;/P&gt;&lt;P&gt;AND stpo~stlnr = c_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you are using FOR ALL ENTRIES it is compulsory to check initial or not&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT  i_stpo[] IS INITIAL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 10:14:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523852#M847594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T10:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with ENDSELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523853#M847595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In first its not possible to write endselect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when we use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It means we are executing a loop which retrieves records one by one but in (1) you are using caluse "for all entries" which is used to avoid looping. So here all the records come from database at a single time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In second you can use endselect but for performance point of view no one recommend to use endselect because it is costlier as it retrives all records one by one from database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 10:14:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523853#M847595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T10:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with ENDSELECT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523854#M847596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in both cases, instead of &lt;EM&gt;INTO itab&lt;/EM&gt; you have to use like: &lt;EM&gt;INTO TABLE itab&lt;/EM&gt;. Than you don't need ENDSELECT. (INTO puts the selected lines one by one into a structure, INTO TABLE puts the selected lines into an internal table in one go.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 10:24:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-endselect/m-p/3523854#M847596</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-03-10T10:24:53Z</dc:date>
    </item>
  </channel>
</rss>

