Deadlines and SAP Calendar

J. Felipe Uribe Duque FelipeUribe at netscape.net
Thu Dec 13 17:49:27 EST 2001


Hi Alon,
 
I appreciate your help, I'll implement this method.
 
I'll let you know how it works in our factory.
 
Thanks a lot.
 
Felipe Uribe.
 
 
"Raskin, Alon (Soliance)" <ARaskin at cps-satx.com> wrote:
 
>There is an object called FACTORYCAL. You could always sub-type it and
>implement the method below. Both would work. I guess its just semantics.
>(which in OO programming is important).
>
>Regards,
>
>
>Alon Raskin
>Workflow Advisor - Soliance
>(xtn. 3183)
>
>-----Original Message-----
>From: McKenney, Bill [mailto:Bill.McKenney at anheuser-busch.com]
>Sent: December 13 2001 4:19
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Re: Deadlines and SAP Calendar
>
>Hi Felipe,
>I wrote a method in the business object and coded it as follows:     ZOFFSET
>is
>set to 3 days in the container, just so we could change the number of
>business
>days by simply changing the container value.
>
>
>
>BEGIN_METHOD ZCALCDEADLINE CHANGING CONTAINER.
>
> DATA: FACTORYCALENDARID LIKE SCAL-FCALID,
>       DATE_FROM LIKE SCAL-DATE,
>       FACTORYDATE LIKE SCAL-FACDATE,
>       CORRECTION LIKE SCAL-INDICATOR,
>       DEADLINE LIKE SCAL-DATE,
>       OFFSET TYPE I.
>
> SWC_GET_ELEMENT CONTAINER 'ZFactoryCalendarID' FACTORYCALENDARID.
> SWC_GET_ELEMENT CONTAINER 'ZDate_from' DATE_FROM.
> SWC_GET_ELEMENT CONTAINER 'Zcorrection' CORRECTION.
> SWC_GET_ELEMENT CONTAINER 'ZOffset' OFFSET.
>
> IF CORRECTION IS INITIAL.
>   CORRECTION = '+'.
> ENDIF.
>
> CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
>       EXPORTING
>          CORRECT_OPTION        = CORRECTION
>          DATE                  = DATE_FROM
>          FACTORY_CALENDAR_ID   = FACTORYCALENDARID
>       IMPORTING
>*         DATE           =
>          FACTORYDATE           = FACTORYDATE
>*         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 OFFSET IS INITIAL.
>   FACTORYDATE = FACTORYDATE + OFFSET.
> ENDIF.
>
>*  Convert the factory date into a normal calendar date
> CALL FUNCTION 'FACTORYDATE_CONVERT_TO_DATE'
>       EXPORTING
>          FACTORYDATE          = FACTORYDATE
>          FACTORY_CALENDAR_ID  = FACTORYCALENDARID
>       IMPORTING
>          DATE                 = DEADLINE
>       EXCEPTIONS
>          CALENDAR_BUFFER_NOT_LOADABLE = 1
>          FACTORYDATE_AFTER_RANGE      = 2
>          FACTORYDATE_BEFORE_RANGE     = 3
>          FACTORYDATE_INVALID          = 4
>          FACTORY_CALENDAR_ID_MISSING  = 5
>          FACTORY_CALENDAR_NOT_FOUND   = 6
>          OTHERS                       = 7.
>
> if sy-sysid = 'BBD'.
>   DEADLINE = DATE_FROM.
> endif.
>
>* Set the deadline parameter to date calculated
> SWC_SET_ELEMENT CONTAINER 'ZDeadline' DEADLINE.
>
>END_METHOD.
>
>
>The container elements were:
>
>ZOFFSET         3
>ZCORRECTION             +
>ZDATE_FROM              &REQREQ.CREATEDATE&
>ZFACTORYCALENDARID              US
>
>
>
>This resulted in a deadline date of 3 workdays.
>
>Hopes this helps.
>
>Bill McKenney
>B2B Team
>PPR - 1CC-10 [mailto:bill.mckenney at anheuser-busch.com]
>> * (314)589-7917         * (314)589-7787
>>
>
>
>-----Original Message-----
>From: J. Felipe Uribe Duque [mailto:FelipeUribe at netscape.net]
>Sent: Thursday, December 13, 2001 3:19 PM
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Deadlines and SAP Calendar
>
>
>Hi everyone,
>
>Web  re creating a Workflow in which Ib  m using deadlines to control the
>time
>per each user. Te question is regarding to the SAP calendar, does this
>deadlines
>the way to control the time using the calendar defined in SAP, i.e. If I set
>in
>the task the b  Latest endb   tab with 4 days and the workflow is started on
>Friday, how could I set it up to donb  t  include Saturday and Sunday as
>working
>days?.
>
>Tanks a lot for any suggestions
>
>Felipe Uribe
>
>
>
>
>
>--
>
>
>
>
>__________________________________________________________________
>Your favorite stores, helpful shopping tools and great gift ideas.
>Experience
>the convenience of buying online with Shop at Netscape!
>http://shopnow.netscape.com/
>
>Get your own FREE, personal Netscape Mail account today at
>http://webmail.netscape.com/
>
--
 
 
 
 
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop at Netscape! http://shopnow.netscape.com/
 
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
 


More information about the SAP-WUG mailing list