06-03-2008 11:47 AM
is there any function module which could comput difference between two dates specific to a factory calender.
06-03-2008 11:48 AM
06-03-2008 11:54 AM
06-03-2008 11:54 AM
We use a combination of FMs
DATE_CONVERT_TO_FACTORYDATE
and
RKE_SELECT_FACTDAYS_FOR_PERIOD
Something like this is the final computation
* get range of working calendar dates
CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
EXPORTING
I_DATAB = request_date
I_DATBI = action_date
I_FACTID = 'US'
TABLES
ETH_DATS = wdates
EXCEPTIONS
DATE_CONVERSION_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
raise dates_error.
ENDIF.
LOOP at wdates.
if wdates-periodat gt request_date.
add 1 to days.
endif.
ENDLOOP.
days_to_complete = days.