<?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: Shall I use SELECT SINGLE?? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211725#M1205539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you use &lt;STRONG&gt;select..single&lt;/STRONG&gt; you will need to use that in a loop.&lt;/P&gt;&lt;P&gt;So that for every material in the loop you use select single which will retrieve 1 record each for a material...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more point for Select single ...when you use select single ...you need to provide the entire key of the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Feb 2009 14:40:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-25T14:40:54Z</dc:date>
    <item>
      <title>Shall I use SELECT SINGLE??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211722#M1205536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Iu2019ve retrieved MSEG-MATNR for the condition mseg-mblnr = material doc no. and mseg-mjahr = mat doc year and mseg-zeile = mat doc item.&lt;/P&gt;&lt;P&gt;And my retrieved data mseg data in i_mseg is like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mblnru2026u2026u2026..mjahru2026..zeilen.u2026u2026.matnr&lt;/P&gt;&lt;P&gt;0049000242....1995......0003........YY-110&lt;/P&gt;&lt;P&gt;0049000242u2026.1995u2026u20260004u2026u2026.YY-120&lt;/P&gt;&lt;P&gt;0049000248....1995u2026u20260001u2026u2026..40-110C&lt;/P&gt;&lt;P&gt;0049000248u2026.1995u2026u20260002........40-200C&lt;/P&gt;&lt;P&gt;0049000248u2026.1995u2026u20260003........40-210&lt;/P&gt;&lt;P&gt;0049000248u2026.1995u2026u20260004........L-40C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now Iu2019ll have to fetch:&lt;/P&gt;&lt;P&gt;MAKT-MAKTX for the condition MAKT-MATNR=MSEG-MATNR and MAKT-SPRAS = u2018ENu2019.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shall I use select single or normal select queries for makt-maktx retrieval?&lt;/P&gt;&lt;P&gt;If select single, then why and if not, then why?	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please guide?&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 14:23:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211722#M1205536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T14:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Shall I use SELECT SINGLE??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211723#M1205537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can retrive material texts for all the materials retreived in your table by using &lt;STRONG&gt;Select..for all entries&lt;/STRONG&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me knwo if this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 14:29:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211723#M1205537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T14:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Shall I use SELECT SINGLE??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211724#M1205538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think for all entries will work in this case but trying to be understand why not select single here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 14:31:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211724#M1205538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T14:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Shall I use SELECT SINGLE??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211725#M1205539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you use &lt;STRONG&gt;select..single&lt;/STRONG&gt; you will need to use that in a loop.&lt;/P&gt;&lt;P&gt;So that for every material in the loop you use select single which will retrieve 1 record each for a material...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more point for Select single ...when you use select single ...you need to provide the entire key of the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 14:40:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211725#M1205539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T14:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Shall I use SELECT SINGLE??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211726#M1205540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks anuradha.hope this will work.Let me check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 14:44:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211726#M1205540</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T14:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Shall I use SELECT SINGLE??</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211727#M1205541</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;It depends of how many records you expect to read. If you have a reduced amount of records I would expect for the join statement to underperform, even if the access to the data bank is faster.&lt;/P&gt;&lt;P&gt;But at a considerable amount of data the join might be a lot faster. Use the tc SM30 to test your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a test script (for development system):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: mseg, makt.

SELECT-OPTIONS: s_mblnr FOR mseg-mblnr,
                s_mjahr FOR mseg-mjahr,
                s_zeile FOR mseg-zeile.
PARAMETERS p_join AS CHECKBOX.

DATA: BEGIN OF l_mseg,
        mblnr LIKE mseg-mblnr,
        maktx LIKE makt-maktx,
      END OF l_mseg.

START-OF-SELECTION.
  DO 10000 TIMES.
    IF p_join IS INITIAL.
      SELECT mblnr INTO l_mseg-mblnr FROM mseg WHERE mblnr IN s_mblnr 
                            AND mjahr IN s_mjahr AND zeile IN s_zeile.
        SELECT SINGLE maktx INTO l_mseg-maktx FROM makt 
                                   WHERE matnr EQ mseg-matnr AND spras = sy-langu.
      ENDSELECT.
    ELSE.
      SELECT mblnr maktx INTO l_mseg
               FROM mseg JOIN makt ON makt~matnr = mseg~matnr
               WHERE mblnr IN s_mblnr AND mjahr IN s_mjahr AND zeile IN s_zeile
               AND spras = sy-langu.
      ENDSELECT.
    ENDIF.
  ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Edgar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 14:57:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shall-i-use-select-single/m-p/5211727#M1205541</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T14:57:20Z</dc:date>
    </item>
  </channel>
</rss>

