<?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 looking for FM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329573#M168257</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i need a FM that i give the number of month 01,02....&lt;/P&gt;&lt;P&gt;and i get the date start and end date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 May 2006 18:41:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-09T18:41:06Z</dc:date>
    <item>
      <title>looking for FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329573#M168257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i need a FM that i give the number of month 01,02....&lt;/P&gt;&lt;P&gt;and i get the date start and end date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 18:41:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329573#M168257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-09T18:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: looking for FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329574#M168258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do something like this, but you can't just use the month, you must know the year as well.   Here you can see that we take the parameter date,  and force that date to the 1st day of that month/year,  then use this date to find the end of the month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0001 .


parameters: p_datum type sy-datum.

data: begin_date type sy-datum,
      end_date type sy-datum.

begin_date = p_datum.
begin_date+6(2) = '01' .

call function 'LAST_DAY_OF_MONTHS'
     exporting
          day_in            = begin_date
     importing
          last_day_of_month = end_date.


write:/ begin_date, end_date.

&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, 09 May 2006 18:46:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329574#M168258</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-05-09T18:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: looking for FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329575#M168259</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 this out&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="879223"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;use FM&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;'LAST_DAY_OF_MONTHS'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 18:48:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329575#M168259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-09T18:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: looking for FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329576#M168260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FM "HR_JP_MONTH_BEGIN_END_DATE" (&amp;lt;u&amp;gt;&amp;lt;b&amp;gt; get begin date and end date of a month)&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'HR_JP_MONTH_BEGIN_END_DATE'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      iv_date                   = ld_new_date&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      ev_month_begin_date       = s_begda-low&lt;/P&gt;&lt;P&gt;      ev_month_end_date         = s_begda-high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this&amp;#146;ll give you idea!!&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;P.S award the points.!!! !!!&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Good luck &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Saquib Khan&lt;/P&gt;&lt;P&gt;"Some are wise and some are otherwise"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 18:49:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329576#M168260</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-05-09T18:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: looking for FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329577#M168261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date field in SAP is stored with YYYYMMDD(8 characters field). So to find the month, look at position 5th and 6th of the field. &lt;/P&gt;&lt;P&gt;Month = GV_DATE+4(2).&lt;/P&gt;&lt;P&gt;To get the first date of the month, set position 7th and 8th as '01'.&lt;/P&gt;&lt;P&gt;GV_DATE+6(2) = '01'.&lt;/P&gt;&lt;P&gt;FirstDate = GV_DATE.&lt;/P&gt;&lt;P&gt;To get the last date of the month, add 31 days to the first date of the month, then set position 7th and 8th as '01', lastly deduct the date by 1.&lt;/P&gt;&lt;P&gt;NextMonth = FirstDate + 31.&lt;/P&gt;&lt;P&gt;NextMonth+6(2) = '01'.&lt;/P&gt;&lt;P&gt;LastDate = NextMonth - 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 18:53:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329577#M168261</guid>
      <dc:creator>nablan_umar</dc:creator>
      <dc:date>2006-05-09T18:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: looking for FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329578#M168262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please award points !!!&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 19:46:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-fm/m-p/1329578#M168262</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-05-09T19:46:53Z</dc:date>
    </item>
  </channel>
</rss>

