Deadline Monitoring on Weekends and Holidays

Dart, Jocelyn jocelyn.dart at sap.com
Mon Feb 23 23:21:51 EST 2009


Hi Judy, 

Further on Rick's reply.... 
There was also a detailed example of how to use Factory Calendar Deadlines in the Practical Workflow for SAP book. 

Using factory calendars is more reliable than basing calculations on day of the week, as factory calendars will take public holidays and varying schedules as well , e.g. 6 day schedules. 

It's a reasonably common approach that many people have used.  

The best function module to call to calculate your deadlines is END_DATE_DETERMINE as this can be used to calculate with and without factory calendars.

Regards,
Jocelyn 

-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Ananth
Sent: Tuesday, 24 February 2009 3:10 PM
To: SAP Workflow Users' Group
Subject: Re: Deadline Monitoring on Weekends and Holidays

Hi Judy,

Just to add to Rick's reply. You can also think of creating a new
method with the following piece of code and pass this deadline date
into your workflow and give this date as the deadline date.

data: lv_deadline_date type sy-datum,
      lv_cur_date      type sy-datum,
      lv_langu         type sy-langu value 'E',
      lv_day_name      type t246-langt.


lv_cur_date = sy-datum.


* Get the week day name

Call function 'ISH_GET_WEEKDAY_NAME'
  Exporting
	data      = lv_cur_date
	language  = lv_language

  Importing
	longtext  = lv_day_name

  Exceptions
	calendar_id = 1
	date_error  = 2
	not_found   = 3
	wrong_input = 4
	others	    = 5.

* if function call is not successfull or if the day is not a friday,
add 1 day to the
* current date to get the deadline date

clear lv_deadline_date.

if sy-subrc <> 0 or lv_day_name <> 'Friday'.
lv_deadline_date = lv_cur_Date + 1.
else.

* if the current day is friday, then add 3 days to get the deadline
date as that of next monday

lv_deadline_date = lv_cur_Date + 3.

endif.

swc_set_element container 'DeadlineDate' lv_deadline_date.


Regards
Ananth

On Tue, Feb 24, 2009 at 3:05 AM, Rick Bakker <rbakker at gmail.com> wrote:
> Hello Judy,
>
> I think the most common mistake with using factory-calendar deadlines
> is the adding of the offset in the deadline tab of the step itself.
>
> Instead of:
> Refer.date/time  Expression
>
> Date            &ZQDEADLINE.DATE&
> Time            &ZQDEADLINE.TIME&
>                  + 24         Hour(s)
>
> you should have something like:
>
> Refer.date/time  Expression
>
> Date            &ZQDEADLINE24HOURS.DATE&
> Time            &ZQDEADLINE24HOURS.TIME&
>                  +          Minute(s)
>
> When you're adding offsets within the step itself, it doesn't take the
> factory calendar into account.
>
> ZQDEADLINE24HOURS is a workflow container element that gets
> instantiated by setting its initial value in the workflow container.
> For example, ZDeadline24Hours could be instantiated with the key
> values:
>
> Offset = 24
> Unit = H (Hours)
> Calendar ID = ZZ
>
> I would undo the change to the execution schedule of RSWWDHEX, that
> just complicates things.
>
> regards
> Rick Bakker
> Hanabi Technology
>
>
> On 2/23/09, Alfano, Judy (ISO) <JAlfano2 at massmutual.com> wrote:
>>
>> Hi All - I've found many questions about deadline monitoring in the
>> archives, but so far haven't seen information about special handling for
>> non-business days.
>>
>> We use a custom escalation process in several of our existing workflows.
>> Recipients are selected from a user maintained table, and deadlines are
>> calculated using a factory calendar that excludes weekends and holidays.
>>
>> For new development I'm working on, I attempted to get away from using that
>> custom process and instead set up an Org Unit and some rules to distribute
>> work items. I'm using the Latest End tab to set up a deadline currently
>> based on the creation time of the work item, plus (for example) 24 hours. My
>> problem has been that items created at 14:00 on Friday, escalate at 14:00
>> Saturday instead of on Monday as I'd hoped. We changed the execution
>> schedule of job RSWWDHEX to a calendar that excludes weekends, but this
>> caused the items to escalate immediately after midnight Monday when the job
>> started running again, so that's not quite right either. If the answer is
>> that I need to calculate that deadline manually in order to skip certain
>> days, I'm fine with that. But I wonder if I'm missing something that the
>> rest of you know??
>>
>> Thanks very much - I'm pretty much a beginner, but have learned a great deal
>> from all of your questions and answers!
>>
>> Judy Alfano
>> MassMutual Financial Group
>> Springfield MA
>>
>>
>>
>>
>> ---------------------------------------------------------
> This
>> e-mail transmission may contain information that is
> proprietary, privileged
>> and/or confidential and is
> intended exclusively for the person(s) to whom it
>> is
> addressed. Any use, copying, retention or disclosure by
> any person other
>> than the intended recipient or the
> intended recipient's designees is
>> strictly prohibited. If
> you are not the intended recipient or their
>> designee,
> please notify the sender immediately by return e-mail and
> delete
>> all
>> copies.
> ---------------------------------------------------------
>>
>>
>>
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>

_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug




More information about the SAP-WUG mailing list