<?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: Check condition points surely ;) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565032#M585165</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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this sample code&lt;/P&gt;&lt;P&gt;YOu can write your own FM with the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

TABLES: T001W.

DATA: WORKDAY_FLAG(1) TYPE C.

CLEAR: T001W, RESULT_DATE.

* Check whether base date is required to be included
IF INCLUDE_BASE &amp;lt;&amp;gt; SPACE.
DATUM = DATUM - 1.
ENDIF.

* Get the Factory calender ID if not supplied
IF FABKL IS INITIAL.
SELECT SINGLE * FROM T001W WHERE WERKS = WERKS.
FABKL = T001W-FABKL.
ENDIF.

* Make sure you have atleaset a day for calculation.
IF DAYS = 0.
DAYS = 1.
ENDIF.

WHILE DAYS &amp;gt; 0.

DATUM = DATUM + 1.

CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
DATE = DATUM
FACTORY_CALENDAR_ID = FABKL
IMPORTING
WORKINGDAY_INDICATOR = WORKDAY_FLAG
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.

CASE SY-SUBRC.
WHEN 1.
RAISE CALENDAR_BUFFER_NOT_LOADABLE.
WHEN 2.
RAISE CORRECT_OPTION_INVALID.
WHEN 3.
RAISE DATE_AFTER_RANGE.
WHEN 4.
RAISE DATE_BEFORE_RANGE.
WHEN 5.
RAISE DATE_INVALID.
WHEN 6.
RAISE FACTORY_CALENDAR_NOT_FOUND.
ENDCASE.

IF WORKDAY_FLAG IS INITIAL.
DAYS = DAYS - 1.
ENDIF.

ENDWHILE.

RESULT_DATE = DATUM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Pavan praveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Pavan praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Aug 2007 07:37:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-03T07:37:18Z</dc:date>
    <item>
      <title>Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565023#M585156</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;Actually i had a requirement in which i have to check the amount for every three days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Example:&amp;lt;/b&amp;gt; It has to check for every three consecutive days such as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;monday, tuesday, wednesday.......&lt;/P&gt;&lt;P&gt;tuesday,wednesay,thursday&lt;/P&gt;&lt;P&gt;wednesay,thursday,friday&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in which i have to omit 2nd and 4th saturdays and also public holidays..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While performing this it has to check If the amount is greater than three crore then it has to fire an mail automatically. Firing an mail if the amount is greater is not a big issue but the problem is how to compare three consecutive days????? how to omit the 2nd &amp;amp; 4th saturdays and also public holidays???&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;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 06:21:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565023#M585156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T06:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565024#M585157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any replies plzzzzzzzzzzzzz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 06:40:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565024#M585157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T06:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565025#M585158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any one reply me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 06:45:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565025#M585158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T06:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565026#M585159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Factory calender has been set in your sap system?&lt;/P&gt;&lt;P&gt;if yese use this function module BKK_CHECK_HOLIDAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[&amp;lt;i&amp;gt;b]regards&lt;/P&gt;&lt;P&gt;Debjani&lt;/P&gt;&lt;P&gt;Rewards point for helpful answer&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 06:54:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565026#M585159</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T06:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565027#M585160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the function module HOLIDAY_GET to get the list of holidays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the function modules HOLIDAY_CALENDAR_GET and FACTORY_CALENDAR_GET to get your holiday and factory calendars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please mark points if the solution was useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 06:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565027#M585160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T06:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565028#M585161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But how to check for the three consecutive days any coding part plz sample&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 06:58:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565028#M585161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T06:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565029#M585162</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;&lt;/P&gt;&lt;P&gt;create a z table which will store last mail sent date.&lt;/P&gt;&lt;P&gt;check laterst mail sent date.&lt;/P&gt;&lt;P&gt;for saturdays check this link: &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="416269"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can get holidays with FM HOLIDAY_GET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create a program and fit this logic in that and schedule this program to rum on every day on a particular time .  chek all dates and if it meets ur requiremetn  send a mail using FM SO_DOCUMENT_SEND_API1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:00:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565029#M585162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T07:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565030#M585163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pass the date range you want to check for holidays to the function module HOLIDAY_GET and it will return you the list of holidays between that range in an internal table. Read the table and you will get to know the list of holidays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please mark points if the solution was useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:03:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565030#M585163</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T07:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565031#M585164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any sample coding plz for my requirement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:30:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565031#M585164</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T07:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Check condition points surely ;)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565032#M585165</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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this sample code&lt;/P&gt;&lt;P&gt;YOu can write your own FM with the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

TABLES: T001W.

DATA: WORKDAY_FLAG(1) TYPE C.

CLEAR: T001W, RESULT_DATE.

* Check whether base date is required to be included
IF INCLUDE_BASE &amp;lt;&amp;gt; SPACE.
DATUM = DATUM - 1.
ENDIF.

* Get the Factory calender ID if not supplied
IF FABKL IS INITIAL.
SELECT SINGLE * FROM T001W WHERE WERKS = WERKS.
FABKL = T001W-FABKL.
ENDIF.

* Make sure you have atleaset a day for calculation.
IF DAYS = 0.
DAYS = 1.
ENDIF.

WHILE DAYS &amp;gt; 0.

DATUM = DATUM + 1.

CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
DATE = DATUM
FACTORY_CALENDAR_ID = FABKL
IMPORTING
WORKINGDAY_INDICATOR = WORKDAY_FLAG
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.

CASE SY-SUBRC.
WHEN 1.
RAISE CALENDAR_BUFFER_NOT_LOADABLE.
WHEN 2.
RAISE CORRECT_OPTION_INVALID.
WHEN 3.
RAISE DATE_AFTER_RANGE.
WHEN 4.
RAISE DATE_BEFORE_RANGE.
WHEN 5.
RAISE DATE_INVALID.
WHEN 6.
RAISE FACTORY_CALENDAR_NOT_FOUND.
ENDCASE.

IF WORKDAY_FLAG IS INITIAL.
DAYS = DAYS - 1.
ENDIF.

ENDWHILE.

RESULT_DATE = DATUM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Pavan praveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Pavan praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:37:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-condition-points-surely/m-p/2565032#M585165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T07:37:18Z</dc:date>
    </item>
  </channel>
</rss>

