<?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 Select-Endselect in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584327#M862974</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to change the following code. Using select-endselect is not allowed, how can I change the code? I also have to avoid of using select *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     SELECT * FROM /PTGWFI/M_PRKMTR&lt;/P&gt;&lt;P&gt;                            WHERE  BELNR   = RBKP-BELNR&lt;/P&gt;&lt;P&gt;                             AND   GJAHR   = RBKP-GJAHR&lt;/P&gt;&lt;P&gt;                             ORDER BY COUNTER DESCENDING.&lt;/P&gt;&lt;P&gt;        LV_PARKRSN = /PTGWFI/M_PRKMTR-PARKRSN.&lt;/P&gt;&lt;P&gt;        LV_BELNR   = /PTGWFI/M_PRKMTR-BELNR.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ENDSELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Apr 2008 07:54:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-02T07:54:39Z</dc:date>
    <item>
      <title>Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584327#M862974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to change the following code. Using select-endselect is not allowed, how can I change the code? I also have to avoid of using select *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     SELECT * FROM /PTGWFI/M_PRKMTR&lt;/P&gt;&lt;P&gt;                            WHERE  BELNR   = RBKP-BELNR&lt;/P&gt;&lt;P&gt;                             AND   GJAHR   = RBKP-GJAHR&lt;/P&gt;&lt;P&gt;                             ORDER BY COUNTER DESCENDING.&lt;/P&gt;&lt;P&gt;        LV_PARKRSN = /PTGWFI/M_PRKMTR-PARKRSN.&lt;/P&gt;&lt;P&gt;        LV_BELNR   = /PTGWFI/M_PRKMTR-BELNR.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ENDSELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 07:54:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584327#M862974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T07:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584328#M862975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Take one internal table which contain this 2 fields,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like in the following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: Begin of itab occurs 1,&lt;/P&gt;&lt;P&gt;LV_PARKRSN  type /PTGWFI/M_PRKMTR-PARKRSN,&lt;/P&gt;&lt;P&gt;LV_BELNR      type /PTGWFI/M_PRKMTR-BELNR,&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM /PTGWFI/M_PRKMTR into corresponding fields of table itab&lt;/P&gt;&lt;P&gt;WHERE BELNR = RBKP-BELNR&lt;/P&gt;&lt;P&gt;AND GJAHR = RBKP-GJAHR&lt;/P&gt;&lt;P&gt;ORDER BY COUNTER DESCENDING.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 07:58:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584328#M862975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T07:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584329#M862976</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;Declare an internal table and fill that table with a select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Select * from Table into Corresponding fields of Table ITab).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can sort the itab by&lt;/P&gt;&lt;P&gt;Sort Itab by COUNTER DESCENDING. and then execute the loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now make a loop at Itab (Internal Table) into wa_Itab (Work Area)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at Itab into wa_Itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do all the processing over here that you previously did in Select - EndSelect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EndLoop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this works out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 08:02:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584329#M862976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T08:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584330#M862977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not allowed to use select *, and instead of using 'into corresponding' I'm only allowed to use simple 'into'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 08:04:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584330#M862977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T08:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584331#M862978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: Begin of itab occurs 1,&lt;/P&gt;&lt;P&gt;LV_PARKRSN type /PTGWFI/M_PRKMTR-PARKRSN,&lt;/P&gt;&lt;P&gt;LV_BELNR type /PTGWFI/M_PRKMTR-BELNR,&lt;/P&gt;&lt;P&gt;counter type /PTGWFI/M_PRKMTR-counter,&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select parkrsn&lt;/P&gt;&lt;P&gt;          belnr&lt;/P&gt;&lt;P&gt;          counter&lt;/P&gt;&lt;P&gt;           from /PTGWFI/M_PRKMTR&lt;/P&gt;&lt;P&gt;          into table itab&lt;/P&gt;&lt;P&gt;          where BELNR = RBKP-BELNR and&lt;/P&gt;&lt;P&gt;                   GJAHR = RBKP-GJAHR&lt;/P&gt;&lt;P&gt;           order by counter descending.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt; if LV_PARKRSN = /PTGWFI/M_PRKMTR-PARKRSN and&lt;/P&gt;&lt;P&gt;    LV_BELNR = /PTGWFI/M_PRKMTR-BELNR.&lt;/P&gt;&lt;P&gt;   EXIT.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 08:04:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584331#M862978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T08:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584332#M862979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i am not understand  &lt;STRONG&gt;/PTGWFI/M&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but try this............................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM  /PTGWFI/M_PRKMTR into corresponding fields of itab&lt;/P&gt;&lt;P&gt;WHERE BELNR = RBKP-BELNR&lt;/P&gt;&lt;P&gt;AND GJAHR = RBKP-GJAHR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ORDER BY COUNTER DESCENDING&lt;/P&gt;&lt;P&gt;LV_PARKRSN = /PTGWFI/M_PRKMTR-PARKRSN.&lt;/P&gt;&lt;P&gt;LV_BELNR = /PTGWFI/M_PRKMTR-BELNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if helpful give reward points&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;pankaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 08:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584332#M862979</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T08:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584333#M862980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;write like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_/PTGWFI/M_PRKMTR type /PTGWFI/M_PRKMTR .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM /PTGWFI/M_PRKMTR&lt;/P&gt;&lt;P&gt;into         wa_/PTGWFI/M_PRKMTR&lt;/P&gt;&lt;P&gt;WHERE BELNR = RBKP-BELNR&lt;/P&gt;&lt;P&gt;AND GJAHR = RBKP-GJAHR&lt;/P&gt;&lt;P&gt;ORDER BY COUNTER DESCENDING.&lt;/P&gt;&lt;P&gt;LV_PARKRSN = /PTGWFI/M_PRKMTR-PARKRSN.&lt;/P&gt;&lt;P&gt;LV_BELNR = /PTGWFI/M_PRKMTR-BELNR.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 08:39:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584333#M862980</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T08:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584334#M862981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi experts,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I want to change the following code. Using select-endselect is not allowed, how can I change the code? I also have to avoid of using select *.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt;      SELECT * FROM /PTGWFI/M_PRKMTR&lt;/P&gt;&lt;P&gt;&amp;gt;                             WHERE  BELNR   = RBKP-BELNR&lt;/P&gt;&lt;P&gt;&amp;gt;                              AND   GJAHR   = RBKP-GJAHR&lt;/P&gt;&lt;P&gt;&amp;gt;                              ORDER BY COUNTER DESCENDING.&lt;/P&gt;&lt;P&gt;&amp;gt;         LV_PARKRSN = /PTGWFI/M_PRKMTR-PARKRSN.&lt;/P&gt;&lt;P&gt;&amp;gt;         LV_BELNR   = /PTGWFI/M_PRKMTR-BELNR.&lt;/P&gt;&lt;P&gt;&amp;gt;         EXIT.&lt;/P&gt;&lt;P&gt;&amp;gt;       ENDSELECT.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's another alternative:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lv_counter TYPE /PTGWFI/M_PRKMTR-counter.

SELECT MAX( counter ) INTO lv_counter FROM /ptgwfi/m_prkmtr
    WHERE belnr EQ rbkp-belnr
      AND gjahr EQ rbkp-gjahr.

SELECT parkrsn belnr INTO (lv_parkrsn, lv_belnr) FROM /ptgwfi/m_prkmtr
    WHERE belnr EQ rbkp-belnr
      AND gjahr EQ rbkp-gjahr
      AND counter EQ lv_counter.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be interesting to compare the performance of the various alternatives, as matched against the original.  SELECT... ENDSELECT should generally not be used, but there are times when it is the most appropriate construct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 08:51:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584334#M862981</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-04-02T08:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584335#M862982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; hi,&lt;/P&gt;&lt;P&gt;&amp;gt; i am not understand  &lt;STRONG&gt;/PTGWFI/M&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just for information, /PTGWFI/ is a &lt;EM&gt;namespace&lt;/EM&gt;.  It serves to seperate different applications from each other.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 08:58:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584335#M862982</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-04-02T08:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584336#M862983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;/PTGWFI/M_PRKMTR is a transparent table in SAP it is for LIX Parked Process Monitor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:14:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584336#M862983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584337#M862984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, and you use the whole thing as the table name, but technically, the /PTGWFI/ is the namespace - the table is M_PRKMTR.  This allows us to, for example, have a table M_PRKMTR that is part of BI - it would be called /BIC/M_PRKMTR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:17:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584337#M862984</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-04-02T09:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select-Endselect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584338#M862985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answer, respect! &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:52:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-endselect/m-p/3584338#M862985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:52:45Z</dc:date>
    </item>
  </channel>
</rss>

