09-11-2008 1:56 PM
Hi Experts,
I want to calculate the no. of days by passing period and year only.
I do not have date.
Please let me know if there is any function module to fulfill my requirements.
For example:
Number of days between 09/2008 to 07/2007
Thanks in advance.
Regards
Swati
09-11-2008 2:00 PM
Use FM WEEK_GET_FIRST_DAY to get the first day of week. then subtract those dates to get number of days.
09-11-2008 2:00 PM
Use FM WEEK_GET_FIRST_DAY to get the first day of week. then subtract those dates to get number of days.
09-11-2008 2:01 PM
How are you going to do it without knowing the date?
The number of days between 1/11/2008 and 31/12/2008 is different to the number of days between 30/11/2008 and 31/12/2008
The question as it stands, doesn't really make sense.
09-11-2008 2:04 PM
Hello check these FM
HR_SGPBS_ADD_TIME_TO_DATE
HR_MX_DAYS_PER_YEAR
FIMA_DAYS_BETWEEN_TWO_DATES
Thanks
09-11-2008 2:17 PM
There is no straight function module to give that value but you can use the function module
NUMBER_OF_DAYS_PER_MONTH_GET to get the number of days per given month and arrive at your requirement
You need to loop between the range and and iteratively accumulate the no of days and then can find the number of days between the periods
09-11-2008 2:19 PM
Hi
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = date1
date2 = date2
OUTPUT_FORMAT = '01'
IMPORTING
YEARS =
MONTHS =
DAYS =
EXCEPTIONS
INVALID_DATES_SPECIFIED = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope it solves your problem
~hitesh