<?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: Program for Monday dates in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833908#M663488</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subha&lt;/P&gt;&lt;P&gt;use following sample report, you can find so many solutions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get week day 1st and use IF condition work with your statments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZEXAMPLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DAYNAMES OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE T246.&lt;/P&gt;&lt;P&gt;DATA: END OF DAYNAMES.&lt;/P&gt;&lt;P&gt;DATA: V_WEEK LIKE SCAL-WEEK,&lt;/P&gt;&lt;P&gt;      WOTNR TYPE P,&lt;/P&gt;&lt;P&gt;      V_MONDAY LIKE SCAL-DATE.&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;CALL FUNCTION 'DATE_GET_WEEK'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          DATE         = SY-DATUM&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          WEEK         = V_WEEK  "YYYYWW&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;          DATE_INVALID = 1&lt;/P&gt;&lt;P&gt;          OTHERS       = 2.&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;CALL FUNCTION 'WEEK_GET_FIRST_DAY'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          WEEK         = V_WEEK&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          DATE         = V_MONDAY&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;          WEEK_INVALID = 1&lt;/P&gt;&lt;P&gt;          OTHERS       = 2.&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;CALL FUNCTION 'DAY_IN_WEEK'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          DATUM = SY-DATUM&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          WOTNR = WOTNR.&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;CALL FUNCTION 'WEEKDAY_GET'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          LANGUAGE = SY-LANGU&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;          WEEKDAY  = DAYNAMES.&lt;/P&gt;&lt;P&gt;READ TABLE DAYNAMES WITH KEY WOTNR = WOTNR.&lt;/P&gt;&lt;P&gt;WRITE:/ 'DATE:', SY-DATUM,&lt;/P&gt;&lt;P&gt;      / 'WEEK NUMBER:', V_WEEK+4,&lt;/P&gt;&lt;P&gt;      / 'FIRST DAY OF WEEK:', V_MONDAY,&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;&lt;/P&gt;&lt;P&gt;Dont forget to rewards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Sep 2007 03:16:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-22T03:16:31Z</dc:date>
    <item>
      <title>Program for Monday dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833907#M663487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two requiremnts to find Monday value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I need to validate the value of a variable whether it is a Monday date or not.&lt;/P&gt;&lt;P&gt;2. I need to validate another varaible whether the date entered is a Monday date which is between 4 weeks back and 20 weeks back.&lt;/P&gt;&lt;P&gt;ie. currentmonday-28 and currentmonday-140.&lt;/P&gt;&lt;P&gt;Please suggest the code for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 03:10:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833907#M663487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T03:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Program for Monday dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833908#M663488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subha&lt;/P&gt;&lt;P&gt;use following sample report, you can find so many solutions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get week day 1st and use IF condition work with your statments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZEXAMPLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DAYNAMES OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE T246.&lt;/P&gt;&lt;P&gt;DATA: END OF DAYNAMES.&lt;/P&gt;&lt;P&gt;DATA: V_WEEK LIKE SCAL-WEEK,&lt;/P&gt;&lt;P&gt;      WOTNR TYPE P,&lt;/P&gt;&lt;P&gt;      V_MONDAY LIKE SCAL-DATE.&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;CALL FUNCTION 'DATE_GET_WEEK'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          DATE         = SY-DATUM&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          WEEK         = V_WEEK  "YYYYWW&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;          DATE_INVALID = 1&lt;/P&gt;&lt;P&gt;          OTHERS       = 2.&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;CALL FUNCTION 'WEEK_GET_FIRST_DAY'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          WEEK         = V_WEEK&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          DATE         = V_MONDAY&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;          WEEK_INVALID = 1&lt;/P&gt;&lt;P&gt;          OTHERS       = 2.&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;CALL FUNCTION 'DAY_IN_WEEK'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          DATUM = SY-DATUM&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          WOTNR = WOTNR.&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;CALL FUNCTION 'WEEKDAY_GET'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          LANGUAGE = SY-LANGU&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;          WEEKDAY  = DAYNAMES.&lt;/P&gt;&lt;P&gt;READ TABLE DAYNAMES WITH KEY WOTNR = WOTNR.&lt;/P&gt;&lt;P&gt;WRITE:/ 'DATE:', SY-DATUM,&lt;/P&gt;&lt;P&gt;      / 'WEEK NUMBER:', V_WEEK+4,&lt;/P&gt;&lt;P&gt;      / 'FIRST DAY OF WEEK:', V_MONDAY,&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;&lt;/P&gt;&lt;P&gt;Dont forget to rewards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 03:16:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833908#M663488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T03:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Program for Monday dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833909#M663489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.I need to validate the value of a variable whether it is a Monday date or not.//&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the FM get_week_info based_on_date &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by passing on a date it gives weekday information perhaps weekstart date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose say that already u had a date in a variable u can compare with the date &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can do a bit of coding to achieve this requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.I need to validate another varaible whether the date entered is a Monday date which is between 4 weeks back and 20 weeks back.&lt;/P&gt;&lt;P&gt;ie. currentmonday-28 and currentmonday-140.//&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im not clear on this requirement 2 . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to use one more fm RP_CALC_DATE*INTRVAL to go back n of days to find particular date . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But make clear with an example . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im not on sap now so u can check the Fm for 1 . Try exe'g this Fm and u will have an idea . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 03:18:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833909#M663489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T03:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Program for Monday dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833910#M663490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : curr_mon like sy-datum,
       mon_4    like sy-datum,
       mon_20   like sy-datum.

CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
  EXPORTING
    DATE_IN        = sy-datum
 IMPORTING
   DATE_OUT       = curr_mon
          .


mon_4 = curr_mon - 28.
mon_20 = curr_mon - 140.

write : / 'Monday of 4 weeks ago : ' , mon_4.
write : / 'Monday of 20 weeks ago : ' , mon_20.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 03:30:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833910#M663490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T03:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Program for Monday dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833911#M663491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Shiba.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want all mondays between 4 weeks and 20 weeks.&lt;/P&gt;&lt;P&gt;Please suggest any way to store all monday values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 05:00:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833911#M663491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T05:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Program for Monday dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833912#M663492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for this you have to loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : count type i default 21.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 16 times. " since 4th to 20th so 20 - 4 = 16 times and count should strt from 28&lt;/P&gt;&lt;P&gt;count = count + 7.&lt;/P&gt;&lt;P&gt;monday = curr_mon - count.&lt;/P&gt;&lt;P&gt;write : / monday.&lt;/P&gt;&lt;P&gt;clear : monday.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Sep 2007 05:11:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833912#M663492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-22T05:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Program for Monday dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833913#M663493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shiba,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I write code like this &lt;/P&gt;&lt;P&gt;data : count type i default 21.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 16 times. " since 4th to 20th so 20 - 4 = 16 times and count should strt from 28&lt;/P&gt;&lt;P&gt;count = count + 7.&lt;/P&gt;&lt;P&gt;monday = curr_mon - count.&lt;/P&gt;&lt;P&gt;write : / monday.&lt;/P&gt;&lt;P&gt;clear : monday.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;curr_mon = sy-datum.&lt;/P&gt;&lt;P&gt;mondate = LOC_VAR_RANGE-LOW.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          DATE_IN  = mondate&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;          DATE_OUT = curr_mon.&lt;/P&gt;&lt;P&gt;break-point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF mondate NE monday.&lt;/P&gt;&lt;P&gt;BREAK-POINT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'RRMS_MESSAGE_HANDLING'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;     I_CLASS                    = 'RSBBS'&lt;/P&gt;&lt;P&gt;     I_TYPE                     = 'I'&lt;/P&gt;&lt;P&gt;      I_NUMBER                  = '000'&lt;/P&gt;&lt;P&gt;      I_MSGV1                   = ' Monday Values between four weeks and 20 weeks back allowed '.&lt;/P&gt;&lt;P&gt;RAISE no_replacement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 05:19:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-for-monday-dates/m-p/2833913#M663493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T05:19:27Z</dc:date>
    </item>
  </channel>
</rss>

