<?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 function module for sundays in a month in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429317#M205442</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need a function module for calculating noof sundays in a month&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Jul 2006 10:17:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-01T10:17:33Z</dc:date>
    <item>
      <title>function module for sundays in a month</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429317#M205442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need a function module for calculating noof sundays in a month&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 10:17:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429317#M205442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-01T10:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: function module for sundays in a month</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429318#M205443</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 to use HOLIDAY_GET&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 11:05:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429318#M205443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-01T11:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: function module for sundays in a month</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429319#M205444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satya,&lt;/P&gt;&lt;P&gt; Please check this piece of code. This serves ur purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="7" type="ul"&gt;&lt;P&gt;Calculation of number of sundays ****&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;*............................................&lt;/P&gt;&lt;P&gt;DAta : month1(2) type c,&lt;/P&gt;&lt;P&gt;       week1 type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;week1 = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Function Module to fetch the Last day of the Month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'LAST_DAY_OF_MONTHS'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;DAY_IN = &amp;lt;ET&amp;gt;-low&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;LAST_DAY_OF_MONTH = VAL1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Function Module to get the day of the week&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DATE_COMPUTE_DAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;DATE = VAL1&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;DAY = DAY1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Calculation of number of sundays&lt;/P&gt;&lt;P&gt;month1 = val14(2).&lt;/P&gt;&lt;P&gt;if month1 = 31.&lt;/P&gt;&lt;P&gt; if DAY1 &amp;lt;= 2 or DAY1 = 7.&lt;/P&gt;&lt;P&gt;  no_sundays = week1.&lt;/P&gt;&lt;P&gt; else.&lt;/P&gt;&lt;P&gt;  no_sundays = week1 - 1.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;elseif month1 = 30.&lt;/P&gt;&lt;P&gt; if DAY1 =1 or DAY1 = 7.&lt;/P&gt;&lt;P&gt;  no_sundays = week1.&lt;/P&gt;&lt;P&gt; else.&lt;/P&gt;&lt;P&gt;  no_sundays = week1 - 1.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;elseif month1 = 29.&lt;/P&gt;&lt;P&gt; if DAY1 = 7.&lt;/P&gt;&lt;P&gt;  no_sundays = week1.&lt;/P&gt;&lt;P&gt; else.&lt;/P&gt;&lt;P&gt;  no_sundays = week1 - 1.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;elseif month1 = 28.&lt;/P&gt;&lt;P&gt;  no_sundays = 4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If found helpful, please do reward.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 15:12:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429319#M205444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-01T15:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: function module for sundays in a month</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429320#M205445</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 can use fm DAY_ATTRIBUTES_GET, it return all characteristics of all days between a period, here you can see the name of the day too, so you can know which are the sundays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 15:30:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429320#M205445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-01T15:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: function module for sundays in a month</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429321#M205446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satya,&lt;/P&gt;&lt;P&gt; Please check this code which is checked for syntax also. Just copy and paste the same in abap editor and check the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="7" type="ul"&gt;&lt;P&gt;Calculation of number of sundays ****&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;*............................................&lt;/P&gt;&lt;P&gt;DAta : month1(2) type c,&lt;/P&gt;&lt;P&gt;       week1 type i,&lt;/P&gt;&lt;P&gt;       date1 type sy-datum,&lt;/P&gt;&lt;P&gt;       val1 type sy-datum,&lt;/P&gt;&lt;P&gt;       day1 type SCAL-INDICATOR,&lt;/P&gt;&lt;P&gt;       no_sundays type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;week1 = 5.&lt;/P&gt;&lt;P&gt;date1 = '20060502'.&lt;/P&gt;&lt;P&gt;*- Function Module to fetch the Last day of the Month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'LAST_DAY_OF_MONTHS'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;DAY_IN = date1&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;LAST_DAY_OF_MONTH = VAL1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Function Module to get the day of the week&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DATE_COMPUTE_DAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;DATE = VAL1&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;DAY = DAY1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Calculation of number of sundays&lt;/P&gt;&lt;P&gt;month1 = val1+6(2).&lt;/P&gt;&lt;P&gt;write : / month1.&lt;/P&gt;&lt;P&gt;if month1 = 31.&lt;/P&gt;&lt;P&gt;if DAY1 &amp;lt;= 2 or DAY1 = 7.&lt;/P&gt;&lt;P&gt;no_sundays = week1.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;no_sundays = week1 - 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;elseif month1 = 30.&lt;/P&gt;&lt;P&gt;if DAY1 = 1 or DAY1 = 7.&lt;/P&gt;&lt;P&gt;no_sundays = week1.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;no_sundays = week1 - 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;elseif month1 = 29.&lt;/P&gt;&lt;P&gt;if DAY1 = 7.&lt;/P&gt;&lt;P&gt;no_sundays = week1.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;no_sundays = week1 - 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;elseif month1 = 28.&lt;/P&gt;&lt;P&gt;no_sundays = 4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / no_sundays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If found helpful, please do reward.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2006 03:58:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429321#M205446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-03T03:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: function module for sundays in a month</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429322#M205447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The number of Sundays ( For that matter any day of the week ) in a month can be either 4 or 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result will be 5 only when then 29 or 30 or 31 occur on Sundays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solution: Use the FM LAST_DAY_OF_MONTHS&lt;/P&gt;&lt;P&gt; to get the lastdate in the month.&lt;/P&gt;&lt;P&gt;if LAST_DAY_OF_MONTH+6(2) = 28.&lt;/P&gt;&lt;P&gt;no_of_sundays = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif LAST_DAY_OF_MONTH+6(2) = 29.&lt;/P&gt;&lt;P&gt;use the Fm date_to_day.&lt;/P&gt;&lt;P&gt;pass the LAST_DAY_OF_MONTH to this FM and get the day of the week. &lt;/P&gt;&lt;P&gt;if WEEKDAY = 'SUNDAY' .&lt;/P&gt;&lt;P&gt;no_of_sundays = 5.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;no_of_sundays = 4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif LAST_DAY_OF_MONTH+6(2) = 30.&lt;/P&gt;&lt;P&gt;use the Fm date_to_day.&lt;/P&gt;&lt;P&gt;pass the LAST_DAY_OF_MONTH to this FM and get the day of the week.&lt;/P&gt;&lt;P&gt;if WEEKDAY = 'SUNDAY' or 'MONDAY'&lt;/P&gt;&lt;P&gt;no_of_sundays = 5.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;no_of_sundays = 4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif LAST_DAY_OF_MONTH+6(2) = 30.&lt;/P&gt;&lt;P&gt;use the Fm date_to_day.&lt;/P&gt;&lt;P&gt;pass the LAST_DAY_OF_MONTH to this FM and get the day of the week. &lt;/P&gt;&lt;P&gt;if WEEKDAY = 'SUNDAY' or 'MONDAY' or 'TUESDAY' . no_of_sundays = 5.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;no_of_sundays = 4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2006 05:14:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429322#M205447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-03T05:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: function module for sundays in a month</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429323#M205448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai thanks for the help...can close it now&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2006 10:02:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-sundays-in-a-month/m-p/1429323#M205448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-03T10:02:53Z</dc:date>
    </item>
  </channel>
</rss>

