<?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/1729163#M317653</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 this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select * from tcurr where gdatu like '%12%' .&amp;lt;/b&amp;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;i hope this will help u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Dec 2006 04:33:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-26T04:33:28Z</dc:date>
    <item>
      <title>select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729158#M317648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi abapers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to select rows from the db table with month as the selection criteria .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the object is as follows :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameter : date like sy-datum obligatory .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from tcurr into it where gdatu = date &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here the date must fall within the month of the selection screen parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie if date = 26.12.2006, then the month is december and hence i have to retrieve all the rows from the table TCURR based upon the condition that the GDATU field must fall in the month of only december .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have tried this but it didn't work out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg : select * from tcurr where gdatu = '&lt;STRONG&gt;12&lt;/STRONG&gt;' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anybody can give me a hint .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx in advance .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 04:25:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729158#M317648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T04:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729159#M317649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;use &amp;lt;b&amp;gt;like&amp;lt;/b&amp;gt; statement instead of &amp;lt;b&amp;gt;=&amp;lt;/b&amp;gt; and use '%' instead of '*'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 04:27:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729159#M317649</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T04:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729160#M317650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Option  1 : &lt;/P&gt;&lt;P&gt;Get the first and last dates of that month, using the date entered, and the fire the select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from tcurr into it where gdatu between first_date and last_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 2:&lt;/P&gt;&lt;P&gt;Get all the rows and then filter. This one will have performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 04:28:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729160#M317650</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T04:28: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/1729161#M317651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let gdatu be 20061226 and date be 20061223.&lt;/P&gt;&lt;P&gt;Modify your select statement's where clause  as below &lt;/P&gt;&lt;P&gt;gdatu&lt;EM&gt;4(2) = date&lt;/EM&gt;4(2).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 04:28:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729161#M317651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T04:28: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/1729162#M317652</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;Get the first day and last day of that month..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then use it in the SQL..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: V_FIRST TYPE SYDATUM.&lt;/P&gt;&lt;P&gt;DATA: V_LAST TYPE SYDATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM TCURR INTO TABLE IT&lt;/P&gt;&lt;P&gt;              WHERE GDATU &amp;gt;= V_FIRST AND&lt;/P&gt;&lt;P&gt;               AND     GDATU &amp;lt;= V_LAST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 04:28:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729162#M317652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T04:28: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/1729163#M317653</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 this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select * from tcurr where gdatu like '%12%' .&amp;lt;/b&amp;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;i hope this will help u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 04:33:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729163#M317653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T04:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729164#M317654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil , &lt;/P&gt;&lt;P&gt;  The date table TCURR is in inverted  format  , so you need to first get the date in inverted format .&lt;/P&gt;&lt;P&gt;First what you need to do is get the first and last date of the month , , convert this into inverted way and created a range using this set of inverted dates and use this in your select statement.&lt;/P&gt;&lt;P&gt;Use the FM RP_LAST_DAY_OF_MONTHS , to get the last day of the month , the first day can be obtained by changing the date to 01 , ie last 2 digits of the date to 01&lt;/P&gt;&lt;P&gt;e.g. if date is v_date , the the command &lt;/P&gt;&lt;P&gt;v_first = v_date.&lt;/P&gt;&lt;P&gt;v_first+6(2) = '01'.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Once you got the first and last day of the month use the FM CONVERSION_EXIT_INVDT_INPUT , to convert the date into invertef format.&lt;/P&gt;&lt;P&gt;Create a range using these values and use this range in select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please revert back in case of queries .&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Reward points if reply is found useful&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 04:36:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729164#M317654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T04:36: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/1729165#M317655</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 example..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_date type sydatum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_last type sydatum.&lt;/P&gt;&lt;P&gt;data: v_first type sydatum.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the last day of the month.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    day_in                  = p_date&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   LAST_DAY_OF_MONTH       = v_last.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the first day of the month.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;v_first = p_date.&lt;/P&gt;&lt;P&gt;v_first+6(2) = '01'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the data.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT * FROM TCURR INTO TABLE IT&lt;/P&gt;&lt;P&gt;             WHERE GDATU &amp;gt;= V_FIRST&lt;/P&gt;&lt;P&gt;             AND      GDATU &amp;lt;= V_LAST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 04:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729165#M317655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T04:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729166#M317656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanx guys for a quick reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2006 04:41:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/1729166#M317656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-26T04:41:00Z</dc:date>
    </item>
  </channel>
</rss>

