<?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 Statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463778#M218601</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to select some data from a database table&lt;/P&gt;&lt;P&gt;depending upon the option the user chooses from the&lt;/P&gt;&lt;P&gt;selection screen. There are three possiblities:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT *&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE tsp01_tab&lt;/P&gt;&lt;P&gt;     UP TO 20 ROWS&lt;/P&gt;&lt;P&gt;    FROM tsp01&lt;/P&gt;&lt;P&gt;   WHERE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Credit Notes / Invoices&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         (&lt;/P&gt;&lt;P&gt;               rq0name  = wa_rq0name&lt;/P&gt;&lt;P&gt;           AND rq1name  = wa_rq1name&lt;/P&gt;&lt;P&gt;           AND rq2name  = wa_rq2name&lt;/P&gt;&lt;P&gt;           AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;           AND rqcretime LE wa_end&lt;/P&gt;&lt;P&gt;           AND &amp;lt;b&amp;gt;select_option&amp;lt;/b&amp;gt; = '1'&lt;/P&gt;&lt;P&gt;         )&lt;/P&gt;&lt;P&gt;                 OR&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Customer Statements&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         (&lt;/P&gt;&lt;P&gt;               rq0name  = wa_rq0name&lt;/P&gt;&lt;P&gt;           AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;           AND rqcretime LE wa_end&lt;/P&gt;&lt;P&gt;           AND &amp;lt;b&amp;gt;select_option&amp;lt;/b&amp;gt; = '3'&lt;/P&gt;&lt;P&gt;         )&lt;/P&gt;&lt;P&gt;                 OR&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Reminders&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          (&lt;/P&gt;&lt;P&gt;               rq0name  = wa_rq0name&lt;/P&gt;&lt;P&gt;           AND rq2name LIKE 'DUN%'&lt;/P&gt;&lt;P&gt;           AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;           AND rqcretime LE wa_end&lt;/P&gt;&lt;P&gt;           AND &amp;lt;b&amp;gt;select_option&amp;lt;/b&amp;gt; = '3'&lt;/P&gt;&lt;P&gt;         ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the above you can see that the &amp;lt;b&amp;gt;select_option&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;is the screen parameter. However, I can't activate the&lt;/P&gt;&lt;P&gt;code because the checker says 'Field select_option unknown'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody know how I can get around this??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Jul 2006 12:40:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-04T12:40:24Z</dc:date>
    <item>
      <title>SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463778#M218601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to select some data from a database table&lt;/P&gt;&lt;P&gt;depending upon the option the user chooses from the&lt;/P&gt;&lt;P&gt;selection screen. There are three possiblities:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT *&lt;/P&gt;&lt;P&gt;    INTO CORRESPONDING FIELDS OF TABLE tsp01_tab&lt;/P&gt;&lt;P&gt;     UP TO 20 ROWS&lt;/P&gt;&lt;P&gt;    FROM tsp01&lt;/P&gt;&lt;P&gt;   WHERE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Credit Notes / Invoices&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         (&lt;/P&gt;&lt;P&gt;               rq0name  = wa_rq0name&lt;/P&gt;&lt;P&gt;           AND rq1name  = wa_rq1name&lt;/P&gt;&lt;P&gt;           AND rq2name  = wa_rq2name&lt;/P&gt;&lt;P&gt;           AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;           AND rqcretime LE wa_end&lt;/P&gt;&lt;P&gt;           AND &amp;lt;b&amp;gt;select_option&amp;lt;/b&amp;gt; = '1'&lt;/P&gt;&lt;P&gt;         )&lt;/P&gt;&lt;P&gt;                 OR&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Customer Statements&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         (&lt;/P&gt;&lt;P&gt;               rq0name  = wa_rq0name&lt;/P&gt;&lt;P&gt;           AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;           AND rqcretime LE wa_end&lt;/P&gt;&lt;P&gt;           AND &amp;lt;b&amp;gt;select_option&amp;lt;/b&amp;gt; = '3'&lt;/P&gt;&lt;P&gt;         )&lt;/P&gt;&lt;P&gt;                 OR&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            Reminders&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          (&lt;/P&gt;&lt;P&gt;               rq0name  = wa_rq0name&lt;/P&gt;&lt;P&gt;           AND rq2name LIKE 'DUN%'&lt;/P&gt;&lt;P&gt;           AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;           AND rqcretime LE wa_end&lt;/P&gt;&lt;P&gt;           AND &amp;lt;b&amp;gt;select_option&amp;lt;/b&amp;gt; = '3'&lt;/P&gt;&lt;P&gt;         ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the above you can see that the &amp;lt;b&amp;gt;select_option&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;is the screen parameter. However, I can't activate the&lt;/P&gt;&lt;P&gt;code because the checker says 'Field select_option unknown'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody know how I can get around this??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:40:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463778#M218601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463779#M218602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u have to pass the field of that selec_option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select screen&lt;/P&gt;&lt;P&gt; select-options:  s_budat for sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select * from vbrk into corresponding fields of table xvbrk&lt;/P&gt;&lt;P&gt;where fkdat in s_budat.&amp;lt;/b&amp;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;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:44:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463779#M218602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463780#M218603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of writing such a complex select u cud write seperate selects based on select_option as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF select_option = 1.&lt;/P&gt;&lt;P&gt;1st select in to table ITAB.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;IF select_option = 2.&lt;/P&gt;&lt;P&gt;2nd select appending records in table ITAB.&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;IF select_option = 2.&lt;/P&gt;&lt;P&gt;3rd select appending records in table ITAB.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:44:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463780#M218603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463781#M218604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since select_option  is not in your table, you can not use it like that.  You must break your select statement into 3 separate select statements and wrapper with an IF statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if select_option  = 1.

SELECT *
INTO CORRESPONDING FIELDS OF TABLE tsp01_tab
UP TO 20 ROWS
FROM tsp01
WHERE
* Credit Notes / Invoices
(
rq0name = wa_rq0name
AND rq1name = wa_rq1name
AND rq2name = wa_rq2name
AND rqcretime GE wa_start
AND rqcretime LE wa_end.


endif.


etc.
etc.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you may want to explore a dynamic WHERE clause based on your SELECT_OPTION field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:44:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463781#M218604</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-04T12:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463782#M218605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot specify the name of a select option in the where clause of a select statement. The compiler assumes that to be a field name and checks for the same in the table. Hence the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, your code should be:&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE tsp01_tab&lt;/P&gt;&lt;P&gt;UP TO 20 ROWS&lt;/P&gt;&lt;P&gt;FROM tsp01&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Credit Notes / Invoices&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;rq0name = wa_rq0name&lt;/P&gt;&lt;P&gt;AND rq1name = wa_rq1name&lt;/P&gt;&lt;P&gt;AND rq2name = wa_rq2name&lt;/P&gt;&lt;P&gt;AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;AND rqcretime LE wa_end&lt;/P&gt;&lt;P&gt;AND &amp;lt;b&amp;gt;fieldname = select_option&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you looking to execute the select statement based on the parameter value? YOu should try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF select_option = '1'.&lt;/P&gt;&lt;P&gt;SELECT......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSEIF select_option = '2'.&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;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:45:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463782#M218605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463783#M218606</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 should declare and use the select-options like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_date for sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from "XXX' in to .... where date in S_DATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs,&lt;/P&gt;&lt;P&gt;Venkat Ramanan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:45:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463783#M218606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463784#M218607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Spool table there is no field called select_option. I guess you are validating againist the Output device. if so the field is &amp;lt;b&amp;gt;RQDEST&amp;lt;/b&amp;gt;. ie your statment will be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.....AND rqcretime LE wa_end
AND RQDEST = '1'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;TM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:45:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463784#M218607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463785#M218608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if select_option =1.&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE tsp01_tab&lt;/P&gt;&lt;P&gt;UP TO 20 ROWS&lt;/P&gt;&lt;P&gt;FROM tsp01&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Credit Notes / Invoices&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rq0name = wa_rq0name&lt;/P&gt;&lt;P&gt;AND rq1name = wa_rq1name&lt;/P&gt;&lt;P&gt;AND rq2name = wa_rq2name&lt;/P&gt;&lt;P&gt;AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;AND rqcretime LE wa_end&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if select_option = '2'.&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE tsp01_tab&lt;/P&gt;&lt;P&gt;UP TO 20 ROWS&lt;/P&gt;&lt;P&gt;FROM tsp01&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Customer Statements&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;rq0name = wa_rq0name&lt;/P&gt;&lt;P&gt;AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;AND rqcretime LE wa_end&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;if select_optios = '3'.&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE tsp01_tab&lt;/P&gt;&lt;P&gt;UP TO 20 ROWS&lt;/P&gt;&lt;P&gt;FROM tsp01&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Reminders&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;rq0name = wa_rq0name&lt;/P&gt;&lt;P&gt;AND rq2name LIKE 'DUN%'&lt;/P&gt;&lt;P&gt;AND rqcretime GE wa_start&lt;/P&gt;&lt;P&gt;AND rqcretime LE wa_end&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;Make the above changes.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:46:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463785#M218608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463786#M218609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example of using a dynamic WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

parameters: selopt type c.
data: tsp01_tab type table of tsp01 with header line.
data: where type table of string with header line.


case selopt  .
  when '1'.
    clear where. refresh where.
    where = 'rq0name = wa_rq0name'. append where.
    where = 'and rq1name = wa_rq1name'. append where.
    where = 'and rq2name = wa_rq2name'. append where.
    where = 'and rqcretime ge wa_start'.   append where.
    where = 'and rqcretime le wa_end'.   append where.
  when '2'.
    clear where. refresh where.
    where = 'rq0name = wa_rq0name'. append where.
    where = 'and rqcretime ge wa_start'.   append where.
    where = 'and rqcretime le wa_end'.   append where.

  when '3'.
   clear where. refresh where.
    where = 'rq0name = wa_rq0name'. append where.
    where = 'and rq2name = wa_rq2name'. append where.
    where = 'and rqcretime ge wa_start'.   append where.
    where = 'and rqcretime le wa_end'.   append where.

endcase.


select * into corresponding fields of table tsp01_tab
      up to 20 rows
           from tsp01
                where (where).

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:51:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463786#M218609</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-04T12:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT Statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463787#M218610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Guys for all your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich, many thanks for the suggestion I was looking&lt;/P&gt;&lt;P&gt;for. I had done something in ORACLE but didn't know&lt;/P&gt;&lt;P&gt;how to do it in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 13:05:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1463787#M218610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T13:05:27Z</dc:date>
    </item>
  </channel>
</rss>

