‎2008 Mar 24 9:51 AM
Hi all,
I want a function module which calculates for me
the actaul working days between two dates.
for eg the working days between 9th march 2008 and 16th march is 5.
i tried a lot of searching...but havent still found one.
i will continue searching but is anyone knows the FM please let me know.......
‎2008 Mar 24 10:34 AM
Use the FM RKE_SELECT_FACTDAYS_FOR_PERIOD,
Pass I_DATAB as 01.01.2007
I_DATBI as 31.12.2007
I_FACTID as '01'
In my system 01 in table TFACD indicates 5 working days in a week and the holiday calender <blank>. This will not consider holidays.
If you want to exclude holidays also, find a suitable factory calender id which has holiday calender id also included. In my system i could find one factory calender say US.
Pass I_DATAB as 01.01.2007
I_DATBI as 31.12.2007
I_FACTID as 'Z1'
The FM will return all the days in an internal tbl. To get the count of the days, get the number of records returned in the internal table by using
DESCRIBE <tbl> LINES <lines> .
Hope this helps. Reward points if helpful.
Thanks
Balaji
‎2008 Mar 24 10:00 AM
‎2008 Mar 24 10:00 AM
HOLIDAY_CHECK_AND_GET_INFO
Useful for determining whether or not a date is a holiday. Give the function a date, and a holiday calendar, and you can determine if the date is a holiday by checking the parameter HOLIDAY
it may solve ur problem partially
‎2008 Mar 24 10:03 AM
‎2008 Mar 24 10:12 AM
we us a comination of the following functions:
DATE_CONVERT_TO_FACTORYDATE
RKE_SELECT_FACTDAYS_FOR_PERIOD
‎2008 Mar 24 10:07 AM
Hi aditya ,
try this function module .....
WEEK_GET_NR_OF_WORKDAYS......i guess it will solve your problem....
Dont forgot to reward points.....
regards,
Sreenivasa sarma k.
‎2008 Mar 24 10:09 AM
hi,
use the below FM,
FORM add_working_days USING p_days
CHANGING p_paydate TYPE sy-datum.
DATA: gd_factorydat LIKE scal-facdate,
gd_resdate LIKE sy-datum.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
date = p_paydate "Starting date
factory_calendar_id = 'GB'
IMPORTING
factorydate = gd_factorydat. "Factory calender date
Add n number of days to factory date, ignors non working days
gd_factorydat = gd_factorydat + p_days.
Convert factory date back to actual date
CALL FUNCTION 'FACTORYDATE_CONVERT_TO_DATE'
EXPORTING
factorydate = gd_factorydat
factory_calendar_id = 'GB'
IMPORTING
date = gd_resdate. "Actual date
p_paydate = gd_resdate.
ENDFORM.
FACTORYDATE_CONVERT_TO_DATE - In the factory calendar the working days are numbered sequentially from the first working day. The numbers of the working days are called factory dates. This function module calculates the date for a factory date.
DATE_CONVERT_TO_FACTORYDATE-In the factory calendar, the working days are numbered sequentially fromthe first working day. The working day numbers are called the factory date. This function module calculates the factory date for a calendar date. If the date passed is not a working day, the next or previous working day is calculated.
rewards points if useful.
regards
sandhya
‎2008 Mar 24 10:34 AM
Use the FM RKE_SELECT_FACTDAYS_FOR_PERIOD,
Pass I_DATAB as 01.01.2007
I_DATBI as 31.12.2007
I_FACTID as '01'
In my system 01 in table TFACD indicates 5 working days in a week and the holiday calender <blank>. This will not consider holidays.
If you want to exclude holidays also, find a suitable factory calender id which has holiday calender id also included. In my system i could find one factory calender say US.
Pass I_DATAB as 01.01.2007
I_DATBI as 31.12.2007
I_FACTID as 'Z1'
The FM will return all the days in an internal tbl. To get the count of the days, get the number of records returned in the internal table by using
DESCRIBE <tbl> LINES <lines> .
Hope this helps. Reward points if helpful.
Thanks
Balaji
‎2013 Jan 29 10:53 AM