<?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: need a function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-a-function-module/m-p/1956304#M393587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;refer this program and FM&lt;/P&gt;&lt;P&gt;you can get name of the week day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop with your date and cound no of sundys with that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DAYNAMES OCCURS 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE T246.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: END OF DAYNAMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: V_WEEK LIKE SCAL-WEEK,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WOTNR TYPE P,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      V_MONDAY LIKE SCAL-DATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GET THE CURRENT WEEK OF A DATE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DATE_GET_WEEK'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DATE         = SY-DATUM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WEEK         = V_WEEK  "YYYYWW&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DATE_INVALID = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          OTHERS       = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GET THE DATE OF THE FIRST MONDAY OF THE WEEK&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WEEK_GET_FIRST_DAY'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WEEK         = V_WEEK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DATE         = V_MONDAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WEEK_INVALID = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          OTHERS       = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DAY NUMBER OF A DATE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DAY_IN_WEEK'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DATUM = SY-DATUM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WOTNR = WOTNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NAMES OF THE DAYS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WEEKDAY_GET'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          LANGUAGE = SY-LANGU&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WEEKDAY  = DAYNAMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE DAYNAMES WITH KEY WOTNR = WOTNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/ 'DATE:', SY-DATUM,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      / 'WEEK NUMBER:', V_WEEK+4,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      / 'FIRST DAY OF WEEK:', V_MONDAY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      / 'CURRENT DAY OF WEEK:', DAYNAMES-LANGT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewads if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2007 10:00:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-15T10:00:15Z</dc:date>
    <item>
      <title>need a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-a-function-module/m-p/1956302#M393585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    good.. is there any function module that can give the total no. of sundays that lies between two dates? i want to calculate the total no. of working days between two dates and if there are any sundays, i will have to decrement the value by 1...thanks all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 09:50:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-a-function-module/m-p/1956302#M393585</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T09:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: need a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-a-function-module/m-p/1956303#M393586</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 using this FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HOLIDAY_GET&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 09:55:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-a-function-module/m-p/1956303#M393586</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T09:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: need a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-a-function-module/m-p/1956304#M393587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;refer this program and FM&lt;/P&gt;&lt;P&gt;you can get name of the week day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop with your date and cound no of sundys with that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DAYNAMES OCCURS 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE T246.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: END OF DAYNAMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: V_WEEK LIKE SCAL-WEEK,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WOTNR TYPE P,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      V_MONDAY LIKE SCAL-DATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GET THE CURRENT WEEK OF A DATE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DATE_GET_WEEK'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DATE         = SY-DATUM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WEEK         = V_WEEK  "YYYYWW&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DATE_INVALID = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          OTHERS       = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GET THE DATE OF THE FIRST MONDAY OF THE WEEK&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WEEK_GET_FIRST_DAY'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WEEK         = V_WEEK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DATE         = V_MONDAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WEEK_INVALID = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          OTHERS       = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DAY NUMBER OF A DATE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DAY_IN_WEEK'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          DATUM = SY-DATUM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WOTNR = WOTNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NAMES OF THE DAYS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WEEKDAY_GET'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          LANGUAGE = SY-LANGU&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          WEEKDAY  = DAYNAMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE DAYNAMES WITH KEY WOTNR = WOTNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/ 'DATE:', SY-DATUM,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      / 'WEEK NUMBER:', V_WEEK+4,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      / 'FIRST DAY OF WEEK:', V_MONDAY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      / 'CURRENT DAY OF WEEK:', DAYNAMES-LANGT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewads if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 10:00:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-a-function-module/m-p/1956304#M393587</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T10:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: need a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-a-function-module/m-p/1956305#M393588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use DATE_COMPUTE_DAY to determine if a given date is a Sunday or not. The rest of the algorithm to compute the number of non-Sundays between two dates is easy &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 10:01:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-a-function-module/m-p/1956305#M393588</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T10:01:18Z</dc:date>
    </item>
  </channel>
</rss>

