<?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 detect all days until in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875427#M931508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can detect all mondays and assign to internal table.&lt;/P&gt;&lt;P&gt;From   04th April 2008  Monday  &lt;/P&gt;&lt;P&gt;Until    20th April 2009 Monday&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me in this regard&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;erdem sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 May 2008 17:15:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-20T17:15:43Z</dc:date>
    <item>
      <title>detect all days until</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875427#M931508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can detect all mondays and assign to internal table.&lt;/P&gt;&lt;P&gt;From   04th April 2008  Monday  &lt;/P&gt;&lt;P&gt;Until    20th April 2009 Monday&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me in this regard&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;erdem sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 17:15:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875427#M931508</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T17:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: detect all days until</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875428#M931509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here, you get in itab all the days from begin to end, there's also a day parameter to choose wich day to count (1= monday,... 7=sunday).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS: begin TYPE sy-datum,
            end   TYPE sy-datum,
            day   TYPE c.

DATA: l_date TYPE sy-datum,
      l_day TYPE p,
      itab TYPE TABLE OF sy-datum.

l_date = begin.

WHILE l_date &amp;lt;= end.

  CALL FUNCTION 'DAY_IN_WEEK'
       EXPORTING
            datum = l_date
       IMPORTING
            wotnr = l_day.
  IF l_day = day.
    APPEND l_date TO itab.
    l_date = l_date + 7.
    EXIT.
  ENDIF.
  l_date = l_date + 1.
ENDWHILE.

WHILE l_date &amp;lt;= end.

  APPEND l_date TO itab.
  l_date = l_date + 7.
ENDWHILE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 17:29:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875428#M931509</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T17:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: detect all days until</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875429#M931510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thank you very much !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ramiro &lt;/P&gt;&lt;P&gt;can you please tell me how can I replace &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: begin TYPE sy-datum,&lt;/P&gt;&lt;P&gt;                         end   TYPE sy-datum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;through select-options fields instead parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional what happens if end date is not selected ?&lt;/P&gt;&lt;P&gt;How can prevent an error ?&lt;/P&gt;&lt;P&gt;&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;sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 17:50:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875429#M931510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T17:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: detect all days until</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875430#M931511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi give some condition for the end value if the end is not defined..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_date TYPE sy-datum,&lt;/P&gt;&lt;P&gt;      l_day TYPE p,&lt;/P&gt;&lt;P&gt;      itab TYPE TABLE OF sy-datum.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: begin for  sy-datum no intervals, &lt;/P&gt;&lt;P&gt;                end   for  sy-datum no intervals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:  day   TYPE c.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;l_date = begin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if end is initial .&lt;/P&gt;&lt;P&gt;end = end + 20 .&lt;/P&gt;&lt;P&gt;endif .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE l_date &amp;lt;= end.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'DAY_IN_WEEK'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            datum = l_date&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            wotnr = l_day.&lt;/P&gt;&lt;P&gt;  IF l_day = day.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    APPEND l_date TO itab.&lt;/P&gt;&lt;P&gt;    l_date = l_date + 7.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  l_date = l_date + 1.&lt;/P&gt;&lt;P&gt;ENDWHILE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;WHILE l_date &amp;lt;= end.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  APPEND l_date TO itab.&lt;/P&gt;&lt;P&gt;  l_date = l_date + 7.&lt;/P&gt;&lt;P&gt;ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 18:33:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875430#M931511</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T18:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: detect all days until</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875431#M931512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A few changes that should avoid an error, The write sentences are just there for me to debug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above suggestion seems ok if you want to use select-options, because of the nature of the problem I don't think that is possible to use ranges and multiple selections&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS: begin TYPE sy-datum OBLIGATORY,
            end   TYPE sy-datum OBLIGATORY,
            day   TYPE c OBLIGATORY.

DATA: l_date TYPE sy-datum,
      l_day TYPE p,
      itab TYPE TABLE OF sy-datum.

AT SELECTION-SCREEN.
  IF end &amp;lt; begin.
    MESSAGE e001(00) WITH 'End must be greather than begin'.
  ENDIF.

  IF NOT day CO '1234567'.
    MESSAGE e001(00) WITH 'Day must be from 1 to 7'.
  ENDIF.


START-OF-SELECTION.
  l_date = begin.

  WHILE l_date &amp;lt;= end.

    CALL FUNCTION 'DAY_IN_WEEK'
         EXPORTING
              datum = l_date
         IMPORTING
              wotnr = l_day.
    IF l_day = day.
      APPEND l_date TO itab.
      WRITE / l_date.
      l_date = l_date + 7.
      EXIT.
    ENDIF.
    l_date = l_date + 1.
  ENDWHILE.

  WHILE l_date &amp;lt;= end.
    WRITE / l_date.
    APPEND l_date TO itab.
    l_date = l_date + 7.
  ENDWHILE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 19:47:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/detect-all-days-until/m-p/3875431#M931512</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T19:47:48Z</dc:date>
    </item>
  </channel>
</rss>

