<?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 double * from database table? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596483#M1275556</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your inputs,&lt;/P&gt;&lt;P&gt;Anyway select ...end select also hits database table two times in this case.&lt;/P&gt;&lt;P&gt;So declaring internal table to handle these two entries is better solution for this in terms of performance wise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So hopefully no solution to meet what I asked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here one more thing  want to conform you that here f1, f2 are key fields.&lt;/P&gt;&lt;P&gt;We are having values of field f2, so we just need to include them in where condition to get AB,CD of field f1, no need of upto 2 rows here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__Naveen Inuaganti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 May 2009 12:52:52 GMT</pubDate>
    <dc:creator>naveen_inuganti2</dc:creator>
    <dc:date>2009-05-20T12:52:52Z</dc:date>
    <item>
      <title>Select double * from database table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596475#M1275548</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;See the entries in the following database table.&lt;/P&gt;&lt;P&gt;TABLE1&lt;/P&gt;&lt;P&gt;F1 -- F2 -- F3 -- F4 -- F5 etc..,&lt;/P&gt;&lt;P&gt;AB   12    de    effd    32e&lt;/P&gt;&lt;P&gt;CD   34    fr      wref   45fr&lt;/P&gt;&lt;P&gt;EF   34    rfr      wfrf    wfwrf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I need to get the two values of F1 field. Those are AB and CD into two separate variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can get these two values in to two variables with out DECLARING INTERNAL TABLE and with ONE SELECT QUERY?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Naveen Inuganti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 09:49:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596475#M1275548</guid>
      <dc:creator>naveen_inuganti2</dc:creator>
      <dc:date>2009-05-20T09:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Select double * from database table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596476#M1275549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Check the code , it will resolve the issue --&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : w_variable2 TYPE scarr-carrid,
       w_variable1 TYPE scarr-carrid .

SELECT carrid UP TO 2 ROWS FROM scarr
INTO w_variable2 .
  MOVE w_variable2 TO w_variable1.
ENDSELECT.
WRITE : w_variable1, w_variable2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From  your reference I created single silect query without internel table - -&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : w_variable2 TYPE dbtable-f1,
       w_variable1 TYPE dbtable-f1 .

SELECT F1 UP TO 2 ROWS FROM dbtable
INTO w_variable2 .
  MOVE w_variable2 TO w_variable1.
ENDSELECT.
WRITE : w_variable1, w_variable2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:05:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596476#M1275549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T10:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select double * from database table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596477#M1275550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naveen Inuganti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You mean we need to select two rows from &lt;STRONG&gt;DB table&lt;/STRONG&gt;  or any other issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of t_f1,
         f1 type table-f1,
        end of t_f1.

data: wa_f1 like t_f1,
         tbl_f1 like table of t_f1.

select F1 from DBtable
                  into table tbl_f1
                  where " any condition need
                 up to 2 rows.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suneel G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596477#M1275550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T10:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select double * from database table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596478#M1275551</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;You cannot do this without internal table but you can do this using &lt;STRONG&gt;UPTO 2 ROWS&lt;/STRONG&gt; addition with &lt;STRONG&gt;SELECT&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway i fear you cannot get it done using your new technique &lt;EM&gt;Select double * from database table?&lt;/EM&gt; &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Karthik D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:06:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596478#M1275551</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T10:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Select double * from database table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596479#M1275552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the entries in the following database table.&lt;/P&gt;&lt;P&gt;TABLE1&lt;/P&gt;&lt;P&gt;F1 -- F2 -- F3 -- F4 -- F5 etc..,&lt;/P&gt;&lt;P&gt;AB 12 de effd 32e&lt;/P&gt;&lt;P&gt;CD 34 fr wref 45fr&lt;/P&gt;&lt;P&gt;EF 34 rfr wfrf wfwrf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think its not possible without internal table in one select statement but it is possible in two select statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:11:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596479#M1275552</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T10:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select double * from database table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596480#M1275553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is working....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : w_variable2 TYPE scarr-carrid,&lt;/P&gt;&lt;P&gt;       w_variable1 TYPE scarr-carrid,&lt;/P&gt;&lt;P&gt;       flag TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT carrid UP TO 2 ROWS FROM scarr&lt;/P&gt;&lt;P&gt;INTO w_variable2 .&lt;/P&gt;&lt;P&gt;  IF flag IS INITIAL.&lt;/P&gt;&lt;P&gt;    MOVE w_variable2 TO w_variable1.&lt;/P&gt;&lt;P&gt;    flag = 'X'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;WRITE : w_variable1, w_variable2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:15:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596480#M1275553</guid>
      <dc:creator>former_member242255</dc:creator>
      <dc:date>2009-05-20T10:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select double * from database table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596481#M1275554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Naveen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Test the following Sample Code Hope it will solve out your problem,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: ename TYPE emnam,
      ename1 TYPE emnam,
      ename2 TYPE emnam,
      count TYPE i VALUE 1.

SELECT ename FROM pa0001
  INTO ename
  WHERE pernr IN ('00000001', '00000002')
    AND endda = '99991231'.
  IF sy-subrc EQ 0.
    IF count EQ 1.
      ename1 = ename.
      ADD: 1 TO count.
    ELSEIF count EQ 2.
      ename2 = ename.
      ADD: 1 TO count.
    ENDIF.
    CLEAR: ename.
  ENDIF.
ENDSELECT.

WRITE: ename1, / ename2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Reply if any Issue,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:15:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596481#M1275554</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-05-20T10:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Select double * from database table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596482#M1275555</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;Check this too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: MARA.

DATA: var type string.
DATA: var1 type string.
data: var2 type string.

SELECT MATNR FROM MARA UP TO 2 ROWS INTO var.
  IF sy-dbcnt = 1.
    MOVE var to var1.
  elseif sy-dbcnt = 2.
    move var to var2.
  endif.
ENDSELECT.

WRITE:/ VAR1, VAR2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:45:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596482#M1275555</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-05-20T10:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select double * from database table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596483#M1275556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your inputs,&lt;/P&gt;&lt;P&gt;Anyway select ...end select also hits database table two times in this case.&lt;/P&gt;&lt;P&gt;So declaring internal table to handle these two entries is better solution for this in terms of performance wise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So hopefully no solution to meet what I asked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here one more thing  want to conform you that here f1, f2 are key fields.&lt;/P&gt;&lt;P&gt;We are having values of field f2, so we just need to include them in where condition to get AB,CD of field f1, no need of upto 2 rows here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__Naveen Inuaganti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 12:52:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-double-from-database-table/m-p/5596483#M1275556</guid>
      <dc:creator>naveen_inuganti2</dc:creator>
      <dc:date>2009-05-20T12:52:52Z</dc:date>
    </item>
  </channel>
</rss>

