‎2005 Jul 06 3:55 PM
Hi experts,
Can someone guide me how to calculate business days (factory calendar days) no holidays or weekends between two dates. There is a function called 'DATE_CONVERT_TO_FACTORYDATE' but I need to calculate late shipment days between two dates (business days only) without holidays or weekends. Is there another function which can achieve this. Any help is appreciated. Thanks.
KV
‎2005 Jul 06 4:02 PM
‎2005 Jul 06 4:02 PM
‎2005 Jul 06 4:06 PM
Here is a sample....
data: xt001w type t001w.
data: duration type i.
data: sdate type sy-datum.
data: edate type sy-datum.
* Get the factory calendar for specific plant
select single * from t001w into xt001w
where werks = '0004'. " Use your plant
* Set start/end dates
sdate = sy-datum.
edate = '20050731'.
call function 'DURATION_DETERMINE'
exporting
factory_calendar = xt001w-fabkl
importing
duration = duration " In days
changing
start_date = sdate
end_date = edate
exceptions
factory_calendar_not_found = 1
date_out_of_calendar_range = 2
date_not_valid = 3
unit_conversion_error = 4
si_unit_missing = 5
parameters_not_valid = 6
others = 7.
write:/ duration.
Regards,
Rich Heilman
‎2005 Jul 06 5:06 PM
‎2005 Jul 06 4:02 PM
Don't understand what you don't understand.
Your function give you the number of the day for a date.
You use two times to have two number and you make diff between this two number. This diff is the diff of working day.
Is it not easy ?
Frédéric