09-24-2008 7:47 PM
Hi All,
I want to deletermine a date which is Invoice date + 3 working days excluding SAT, SUN and holidays. For e.g, if Invoice date is 18th Sept, 2009, then my desired date should 23rd Sept, 2009.
I do have factory calendar ID but i dont know the proper function module.
Can some one please help me...
09-24-2008 8:04 PM
09-24-2008 8:12 PM
Hi,
check this code,
DATA:
w_date TYPE dats,
w_date1 LIKE scal-date, " dats
w_date2 LIKE scal-date,
i_factid LIKE tkevs-fcalid VALUE 'IN', " IN for India
it_dats TYPE TABLE OF rke_dat,
wa_dats LIKE LINE OF it_dats,
w_lines TYPE i.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
days = '0'
months = '1'
start_date = sy-datum " for example '20090918'
IMPORTING
result_date = w_date. " 1 month added '20091018'
w_date1 = sy-datum.
w_date2 = w_date.
CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
EXPORTING
i_datab = w_date1
i_datbi = w_date2
i_factid = i_factid
TABLES
eth_dats = it_dats. " number of working days between two dates
READ TABLE it_dats INDEX 4 INTO wa_dats.
WRITE :
/ wa_dats-periodat. " new date '20090923'
Hope this will be helpfull...
Regards
Adil
09-24-2008 8:19 PM