Calculate difference between business days

hseider

Member
Is anyone aware of a business function(or some other method) that will calculate the difference between business days? i.e. The business days difference between Friday and Monday is 1. The calendar days difference between Friday and Monday is 3. If Monday is the 4th of July, the business days difference between Friday and Tuesday is 1.

Hal Seider
OneWorldXE ServicePack16 AS400 coexistant
 
This is not exactly what you're looking for but you may be able to take this BSFN and copy/modify to your needs. You give it a Begin or End Date and a number of days to go forward or backward, and a flag to Forward schedule or backward schedule and it returns a date that is "X" Business days forward or backward from the given date.

ForwardBackwardScheduleDates - B3100300
/**************************************************************************
* Notes:
* Purpose:
* This business function will forward or backward schedule
* the input date using the Work Day Calendar Table F0007.
*
* Parameters:
* Input - BranchPlant (MMCU) = Work Order Branch Plant.
* InputDate (DRQJ) = Date to be Validated.
* OutputDate (STRT) = Zeros.
* NoOfDays (LTLV) = No of Days.
* ScheduleType (WS ) = ‘F’ - Forward Schedule
* ‘B’ Backward Schedule.
*
* Output - ErrorCode (ERRC) = ‘1’ if the Date is invalid.
* = ‘0’ if the Date is valid work day.
* OutputDate (STRT) = Scheduled Date.
*
**************************************************************************/

You also may want to look at b3401340 which does what you want - but for MRP. Again it would be a matter of building your own after cloning code from this function.

FWIW,


Larry Jones
[email protected]
OneWorld XE, SP 15.1
HPUX 11, Oracle SE 8.1.6
Mfg, Distribution, Financials
 
Hi Hal,

There is a NER N1700030 “F0007 Count Work Days”. You need to use P00071 “Work Day Calendar” to set workdays calendar and after that NER will give to you number of working days between two dates. On B733.2 there is a problem, if you didn’t setup calendat for begin, end and all days between, NER will not send error flag, just wrong number of days. Be shore that you have setup calendar for every date you may use.

Hope this helps,

Bojan.
 
Back
Top