05-17-2006 11:18 AM
hi,
i would appreciate if someone could help me how to get the difference between two dates but it will exlude the saturday, sunday and holiday in the calculation.
thank you very much.
donna
05-17-2006 11:25 AM
Use this FM
WEEK_GET_NR_OF_WORKDAYS
Another option is u get the number of holidays and substarct it from the date difference
CATSXT_GET_HOLIDAYS
Another helpful forum
https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/6927cccd-0501-0010-4f8f-fbb5fa062365 [original link is broken]
<b>Please Award points if found helpful</b>
05-17-2006 11:22 AM
Hi Donna,
Put the dates in a temp table. Open the loop & for each date check if it is a workday using the function call DATE_CHECK_WORKINGDAY. Increment a counter for total no of working days.
Regards,
Suresh Datti
05-17-2006 11:25 AM
hii
This should help
<b>HOLIDAY_GET</b>
DATE_CHECK_WORKINGDAY
HRWPC_PCR_CHECK_WORKINGDAYS
<b>WEEK_GET_NR_OF_WORKDAYS</b>
<b>WLB3_GET_NUMBER_OF_WORKDAYS</b>
call function 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
exporting
i_datab = p_start
i_datbi = p_end
i_factid = 'P8' " Factory id
tables
eth_dats = idays
exceptions
date_conversion_error = 1
others = 2.
describe table idays lines workingdays.
Reagrds
Naresh
05-17-2006 11:25 AM
Use this FM
WEEK_GET_NR_OF_WORKDAYS
Another option is u get the number of holidays and substarct it from the date difference
CATSXT_GET_HOLIDAYS
Another helpful forum
https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/6927cccd-0501-0010-4f8f-fbb5fa062365 [original link is broken]
<b>Please Award points if found helpful</b>
05-17-2006 11:28 AM
The following code adds n number of WORKING days to a particular date, any days which are not
workings days (i.e. Saturday) will be ignored. For example if your starting date is Friday, adding 3 days
would return a result of Wednesday or if starting date was Wednesday resultant day would be Monday as
Saturday and Sunday are non working days. If you want to add n number of working days but allow result
to be a non working day then click here for alternative code.
See this code sample
http://www.sapdevelopment.co.uk/tips/date/date_factorydat.htm
http://www.sapdevelopment.co.uk/tips/date/date_daysadd.htm
Hope ur problem got solved, reward poinst and close the thraed if it solved.
Message was edited by: Judith Jessie Selvi
05-17-2006 11:38 AM
1. All u need is the factory calender code. You need to check that in SPRO.
2. Once you have that code ,use function module DATE_CONVERT_TO_FACTORYDATE
to convert start_date and end_date to factory calender days.
3. No of days = factory_start_date - factory_end_date
05-17-2006 11:41 AM