<?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 statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015355#M79844</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best source has usual is SAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the way to read data in open sql&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3983358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3983358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Oct 2005 09:35:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-07T09:35:11Z</dc:date>
    <item>
      <title>Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015340#M79829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In open sql select query i want to extract year from database column and compare it with entered value.&lt;/P&gt;&lt;P&gt;for eg.&lt;/P&gt;&lt;P&gt;i want to get employees joined in year 2005&lt;/P&gt;&lt;P&gt;for that i have to extract year from the database column and compare it with 2005&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is it possible in select query?&lt;/P&gt;&lt;P&gt;Please Reply soon i have to complete this today.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 07:20:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015340#M79829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T07:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015341#M79830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your question is not so clear...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please give more details about the column etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think yopu can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS PA_YEAR(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM DB_TAB INTO TABLE WHERE YEAR = PA_YEAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not satified give more details ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 07:40:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015341#M79830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T07:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015342#M79831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  you have not told what is the column type you used in the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lets consider the name of the column is join_date and type is of sy-datum, and your table name is zemp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then do the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: LT_zemp like zemp,&lt;/P&gt;&lt;P&gt;      ls_zemp like line of lt_zemp.&lt;/P&gt;&lt;P&gt;data: limit_date like sy-datum values '20050101'.   "1st jan 2005&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from zemp into ls_zemp.&lt;/P&gt;&lt;P&gt;   if ls_zemp-join_date &amp;gt;= limit_date.&lt;/P&gt;&lt;P&gt;       append ls_zemp to lt_zemp.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;   clear ls_zemp.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please reward point if it answers your need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 07:42:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015342#M79831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T07:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015343#M79832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want a query like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join_dat = '20050101'.&lt;/P&gt;&lt;P&gt;select ename from pa0001 into ename where &lt;/P&gt;&lt;P&gt;begda&lt;EM&gt;4(4) = join_dat&lt;/EM&gt;1(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here begda is column of type dats&lt;/P&gt;&lt;P&gt;so i have extract year from the date and then compare it with 2005.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 07:57:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015343#M79832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T07:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015344#M79833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bharat,&lt;/P&gt;&lt;P&gt;    just one correction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the internal table declartion part..&lt;/P&gt;&lt;P&gt;instead of those like zemp statements..do the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_zemp.&lt;/P&gt;&lt;P&gt;       include structure &amp;lt;your db table name&amp;gt;.&lt;/P&gt;&lt;P&gt;types: end of  ty_zemp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lt_zemp type ty_zemp,&lt;/P&gt;&lt;P&gt;      ls_zemp like line of lt_zemp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now declare the date "limit_date" as i wrote in previous post, and then do the select query as i already gave.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let us know in case of problem..and also let us know the type of date column in your table, if it is not of type sy-datum.&lt;/P&gt;&lt;P&gt;Does this solve your query??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 07:57:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015344#M79833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T07:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015345#M79834</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;try:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
RANGES date FOR pa0001-begda.
CONCATENATE  joindat(4) '0101' INTO date-low.
CONCATENATE  joindat(4) '1231' INTO date-high.
date-option = 'BT'.
date-sign = 'I'.
APPEND date.


SELECT ename FROM pa0001 INTO ename WHERE
begda IN date.
  WRITE: / ename.
ENDSELECT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 08:08:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015345#M79834</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-10-07T08:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015346#M79835</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;Please follow this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS : P_YEAR TYPE &amp;lt;b&amp;gt;VBKD-GJAHR&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select x1 x2 from  &amp;lt;b&amp;gt;tab_name&amp;lt;/b&amp;gt; appending corresponding values of table t_itab where year = &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;P_YEAR&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_itab is the internal table containing the details you need from the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace x1 , x2, year with the correct field values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points if this explanation is useful.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt; Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 08:09:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015346#M79835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T08:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015347#M79836</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;I suggest you usr the LIKE addition in the where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;imagine something like this is stored in the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;31 december 2004 = 20041231&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters : pa_year type year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : l_like(10) value '______'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate year l_like into l_like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from db_tab where date like l_like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will retrieve everything for yea entered by the end user&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS : &lt;/P&gt;&lt;P&gt;-NOTE THAT THE LIKE ADDITION is not the best optimized select statement! It is runtime expensive.&lt;/P&gt;&lt;P&gt;-note that select...endselect is neither the best optimized select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: STEPHAN KAMINSKI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 08:10:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015347#M79836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T08:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015348#M79837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WA(5).&lt;/P&gt;&lt;P&gt;DATA WA_YEAR(4) VALUE '2005'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE WA_YEAR '%' INTO WA .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM &amp;lt;DBTAB&amp;gt;&lt;/P&gt;&lt;P&gt;  WHERE &amp;lt;DATE&amp;gt; LIKE WA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 08:10:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015348#M79837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T08:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015349#M79838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bharat,&lt;/P&gt;&lt;P&gt;        thanks for your second mail..it cleared the doubt..here is the solution.please reward points if its ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just tested this , it works.your lt_tab tabel will contain all the ename whose begda(4) &amp;gt; 2005 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of lt_tab occurs 0,&lt;/P&gt;&lt;P&gt;        ename like pa0001-ename,&lt;/P&gt;&lt;P&gt;        begda like pa0001-begda,&lt;/P&gt;&lt;P&gt;      end of lt_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ename begda from pa0001 into lt_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if lt_tab-begda(4) eq '2005'.&lt;/P&gt;&lt;P&gt;         append lt_tab.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 08:13:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015349#M79838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T08:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015350#M79839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andreas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your solution is the BEST Optimized!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Congratulations!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;except for the select ... endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prefer SELECT INTO TABLE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 08:13:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015350#M79839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T08:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015351#M79840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anid,&lt;/P&gt;&lt;P&gt;Thanks for your quick reply but my present query is here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single SUM( anzhl ) sum( kverb )&lt;/P&gt;&lt;P&gt;into (SLQUOTA,slded)&lt;/P&gt;&lt;P&gt; from pa2006&lt;/P&gt;&lt;P&gt;  where pernr = wa_pa0001-perno&lt;/P&gt;&lt;P&gt;  and ktart = 60 &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; and begda = begda+0(4)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  group by ktart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The line marked star is my query&lt;/P&gt;&lt;P&gt;i have to compare like in raw&lt;/P&gt;&lt;P&gt;year(begda) = begda+0(4)&lt;/P&gt;&lt;P&gt;does this is possible?&lt;/P&gt;&lt;P&gt;Please reply soon,&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 09:05:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015351#M79840</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T09:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015352#M79841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bharat &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WA(5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE begda(4) '%' INTO WA .&lt;/P&gt;&lt;P&gt;*( begda(4) should have the year value say 2005 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single SUM( anzhl ) sum( kverb )&lt;/P&gt;&lt;P&gt;into (SLQUOTA,slded)&lt;/P&gt;&lt;P&gt;from pa2006&lt;/P&gt;&lt;P&gt;where pernr = wa_pa0001-perno&lt;/P&gt;&lt;P&gt;and ktart = 60 &lt;/P&gt;&lt;P&gt;and begda like wa&lt;/P&gt;&lt;P&gt;group by ktart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 09:10:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015352#M79841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T09:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015353#M79842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bharat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This answer was provided to you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas Mann &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Posts: 1,066 &lt;/P&gt;&lt;P&gt;Registered: 3/12/04  &lt;/P&gt;&lt;P&gt;  Re: Select statement   &lt;/P&gt;&lt;P&gt;Posted: Oct 7, 2005 10:08 AM      Reply      E-mail this post  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RANGES date FOR pa0001-begda.&lt;/P&gt;&lt;P&gt;CONCATENATE  joindat(4) '0101' INTO date-low.&lt;/P&gt;&lt;P&gt;CONCATENATE  joindat(4) '1231' INTO date-high.&lt;/P&gt;&lt;P&gt;date-option = 'BT'.&lt;/P&gt;&lt;P&gt;date-sign = 'I'.&lt;/P&gt;&lt;P&gt;APPEND date.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SELECT ename FROM pa0001 INTO ename WHERE&lt;/P&gt;&lt;P&gt;begda IN date.&lt;/P&gt;&lt;P&gt;  WRITE: / ename.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 09:18:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015353#M79842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T09:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015354#M79843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Continuing on Sanjay's explanation I guess that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE begda(4) &amp;lt;b&amp;gt;'%'&amp;lt;/b&amp;gt; INTO WA .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should be written as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE &amp;lt;b&amp;gt;'%'&amp;lt;/b&amp;gt; begda(4)  INTO WA .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e the &amp;lt;b&amp;gt;%&amp;lt;/b&amp;gt; should be prefixed.&lt;/P&gt;&lt;P&gt;Please let us know if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt; Siva&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Sivakumar Muthusamy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 09:27:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015354#M79843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T09:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015355#M79844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best source has usual is SAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the way to read data in open sql&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3983358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3983358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 09:35:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015355#M79844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T09:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015356#M79845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sivakumar Muthusamy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your addition to Sanjay's post is incorrect. Just wanted to make sure it is noted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bharat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are quite a few perfectly correct answers in this thread (including what A Mann gave). Good if you reward and close it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 09:46:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015356#M79845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T09:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015357#M79846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;here is the solution, for your updated query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: START_DAT LIKE SY-DATUM VALUE '20050101',&lt;/P&gt;&lt;P&gt;      END_DAT   LIKE SY-DATUM VALUE '20051231'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single SUM( anzhl ) sum( kverb )&lt;/P&gt;&lt;P&gt;into (SLQUOTA,slded)&lt;/P&gt;&lt;P&gt;from pa2006&lt;/P&gt;&lt;P&gt;where pernr = wa_pa0001-perno&lt;/P&gt;&lt;P&gt;and ktart = 60 &lt;/P&gt;&lt;P&gt;and ( begda GE START_DAT OR&lt;/P&gt;&lt;P&gt;      begda LE END_DAT )&lt;/P&gt;&lt;P&gt;group by ktart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2005 10:03:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1015357#M79846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-07T10:03:31Z</dc:date>
    </item>
  </channel>
</rss>

