<?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: Find a working day in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404801#M1406861</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; solved myself&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Glad you got it going, but you'll notice that a number of people tried to give you a helping hand - maybe they deserve some points for their efforts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If none of them helped at all, you could at least update the forum on how you solved this. That is part of &lt;SPAN __jive_macro_name="thread" id="927634"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Dec 2009 18:38:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-17T18:38:57Z</dc:date>
    <item>
      <title>Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404792#M1406852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to subtract number of days (L_DAYS) from a date (L_DATE) and the result should be a working day. Any FM's to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 19:12:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404792#M1406852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-15T19:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404793#M1406853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or can someone tell me how to check a date (P_DATE) is a working date in a factory calender?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 19:33:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404793#M1406853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-15T19:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404794#M1406854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use function  DATE_CHECK_WORKINGDAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Venu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 19:42:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404794#M1406854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-15T19:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404795#M1406855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check this link:[&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5529242"&gt;&lt;/A&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vikram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 19:52:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404795#M1406855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-15T19:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404796#M1406856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I never found a FM to do this so I made my own based on DATE_CONVERT_TO_FACTORYDATE. Offset is the number of days, correct_option is future or past.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION z_date_convert_to_factorydate.
*"*"Local interface:
*"  IMPORTING
*"     VALUE(CORRECT_OPTION) LIKE  SCAL-INDICATOR DEFAULT '+'
*"     VALUE(DATE) LIKE  SCAL-DATE DEFAULT SY-DATUM
*"     VALUE(FACTORY_CALENDAR_ID) LIKE  SCAL-FCALID DEFAULT 'C1'
*"     VALUE(OFFSET) TYPE  INT4 DEFAULT 0
*"  EXPORTING
*"     VALUE(XDATE) LIKE  SCAL-DATE
*"     VALUE(FACTORYDATE) LIKE  SCAL-FACDATE
*"     VALUE(WORKINGDAY_INDICATOR) LIKE  SCAL-INDICATOR

  CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
       EXPORTING
            correct_option   = correct_option
            date  = date
            factory_calendar_id  = factory_calendar_id
       IMPORTING
            date  = xdate
            factorydate   = factorydate
            workingday_indicator  = workingday_indicator
       EXCEPTIONS
            calendar_buffer_not_loadable = 1
            correct_option_invalid       = 2
            date_after_range             = 3
            date_before_range            = 4
            date_invalid                 = 5
            factory_calendar_not_found   = 6
            OTHERS                       = 7.
  IF NOT workingday_indicator IS INITIAL.
    SUBTRACT 1 FROM offset.
  ENDIF.

  IF offset &amp;gt; 0.
    DO offset TIMES.
      CASE correct_option.
        WHEN '+'.
          ADD 1 TO xdate.
        WHEN '-'.
          SUBTRACT 1 FROM xdate.
      ENDCASE.
      CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
           EXPORTING
                correct_option  = correct_option
                date  = xdate
                factory_calendar_id  = factory_calendar_id
           IMPORTING
                date  = xdate
                factorydate   = factorydate
                workingday_indicator         = workingday_indicator
           EXCEPTIONS
                calendar_buffer_not_loadable = 1
                correct_option_invalid   = 2
                date_after_range   = 3
                date_before_range = 4
                date_invalid   = 5
                factory_calendar_not_found   = 6
                OTHERS    = 7.
    ENDDO.
  ENDIF.
ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Dec 15, 2009 4:40 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 20:15:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404796#M1406856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-15T20:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404797#M1406857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt; 
DATA: lv_working_indicator  TYPE CIND.
DATA: lv_count TYPE i.
DATA: lv_date TYPE sydatum.

lv_date = l_date
  DO.
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
         EXPORTING
              correct_option          = '-'
              date                    = lv_date
              factory_calendar_id     = 'Z3'
         IMPORTING
              workingday_indicator    = lv_working_indicator
         EXCEPTIONS
              calendar_buffer_not_loadable = 1
              correct_option_invalid       = 2
              date_after_range             = 3
              date_before_range            = 4
              date_invalid                 = 5
              factory_calendar_not_found   = 6
              OTHERS                       = 7.
    IF lv_working_indicator IS INITIAL.
      lv_count = lv_count + 1.
    ENDIF.

    IF lv_count = l_days.
      lv_required_working_date = lv_date.
      EXIT.
    ENDIF.
    lv_date  = lv_date - 1.

  ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code should get you the required working day&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 21:36:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404797#M1406857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-15T21:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404798#M1406858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;table TFACS has the factory calender... if you can split the date into year month and date and hit table TFACS if the result is &lt;STRONG&gt;1&lt;/STRONG&gt; its a working day &lt;STRONG&gt;0&lt;/STRONG&gt; for a holiday&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 21:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404798#M1406858</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-12-15T21:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404799#M1406859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Adrian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do Offset times will not work or might not work depending on the requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't know if his requirement is L_DATE - LDAYS or L_DATE - L_DAYS (working)&lt;/P&gt;&lt;P&gt;Ex of first one is 12/15/2009 - 5  days that is 10/12/2009 (includes saturday and sunday)&lt;/P&gt;&lt;P&gt;Ex. for later one is 12/15/2009 - 5 working days that is 12/8/2009 (excludes saturday and sunday)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the first example can directly deduct those many days and use the FM DATE_CONVERT_TO_FACTORYDATE and find if it is a working day or not.&lt;/P&gt;&lt;P&gt;For the 2nd example the above code i have given will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 21:49:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404799#M1406859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-15T21:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404800#M1406860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved myself&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 18:30:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404800#M1406860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-17T18:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Find a working day</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404801#M1406861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; solved myself&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Glad you got it going, but you'll notice that a number of people tried to give you a helping hand - maybe they deserve some points for their efforts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If none of them helped at all, you could at least update the forum on how you solved this. That is part of &lt;SPAN __jive_macro_name="thread" id="927634"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 18:38:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-working-day/m-p/6404801#M1406861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-17T18:38:57Z</dc:date>
    </item>
  </channel>
</rss>

