<?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: substring in select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502437#M1421985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your corresponding database table has the year field and you want to get the data according to the fiscal year &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then try the following ways : .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.

parameters : p_date type datum. " Ur date field.

data : g _year type i.

at selection-screen:.

move p_date+0(4) to g_year.

Then pass g_year in your where clause.

or you can use the FM.

CALL FUNCTION 'GET_CURRENT_YEAR'

    EXPORTING

      bukrs = u2018ur company code'u2019

      date  = ur date field.

    IMPORTING

*      currm = fiscalmonth

      curry = g_year.

here also pass g_year in your where clause.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhinab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Dec 2009 20:21:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-27T20:21:39Z</dc:date>
    <item>
      <title>substring in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502435#M1421983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have a selection screen where year is only input field, and in my table there is a date field, so i have to retrieve the data only of the given year only, so how do i substring the date field of that table and compare with my input in select statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Dec 2009 08:17:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502435#M1421983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-27T08:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: substring in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502436#M1421984</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 sth like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS p_year(4) TYPE n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_flight TYPE TABLE OF sflight,&lt;/P&gt;&lt;P&gt;      year_start TYPE d,&lt;/P&gt;&lt;P&gt;      year_end TYPE d.&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;  CONCATENATE p_year '0101' INTO year_start.&lt;/P&gt;&lt;P&gt;  CONCATENATE p_year '1231' INTO year_end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * FROM sflight INTO TABLE it_flight WHERE fldate BETWEEN year_start AND year_end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Katarzyna Rafalska&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Dec 2009 11:30:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502436#M1421984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-27T11:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: substring in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502437#M1421985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your corresponding database table has the year field and you want to get the data according to the fiscal year &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then try the following ways : .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.

parameters : p_date type datum. " Ur date field.

data : g _year type i.

at selection-screen:.

move p_date+0(4) to g_year.

Then pass g_year in your where clause.

or you can use the FM.

CALL FUNCTION 'GET_CURRENT_YEAR'

    EXPORTING

      bukrs = u2018ur company code'u2019

      date  = ur date field.

    IMPORTING

*      currm = fiscalmonth

      curry = g_year.

here also pass g_year in your where clause.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhinab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Dec 2009 20:21:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502437#M1421985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-27T20:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: substring in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502438#M1421986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please Press F1 on CS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using Contain string you can check the current year in date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Dec 2009 02:54:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502438#M1421986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-28T02:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: substring in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502439#M1421987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After a long time i saw my question and acknowledge that i know the answer...:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: FAGLFLEXA.

SELECT * INTO FAGLFLEXA
  FROM FAGLFLEXA
  WHERE BUDAT LIKE '2011%'.
ENDSELECT.

WRITE: SY-DBCNT.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2011 09:04:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/substring-in-select-statement/m-p/6502439#M1421987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-27T09:04:13Z</dc:date>
    </item>
  </channel>
</rss>

