on 12-19-2007 7:04 AM
hi everybody i want a function module to find no of days between two dates
Hi. You can use function module HR_99S_INTERVAL_BETWEEN_DATES. If you just want the number of days, you can use code like below:
DATA ws_begin_date type sy-datum.
DATA ws_end_date type sy-datum.
DATA days_between type i.
CALL FUNCTION 'HR_99S_INTERVAL_BETWEEN_DATES'
EXPORTING
begda = ws_begin_date
endda = ws_end_date
IMPORTING
days = days_between.
I hope this helps.
- April King
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try FM WFCS_FCAL_WDAYS_GET_S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankit,
You can use following function moduled to get number of days:
1. CONVERT_DATE_TO_INTERNAL- Used to convert DD.MM.YYYY format date to YYYYMMDD format
2. HR_99S_INTERVAL_BETWEEN_DATES- Used to get days where input date should be in YYYYMMDD format.
Regards,
Sudeesh Soni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Function module /SDF/CMO_DATETIME_DIFFERENCE
Uppercase/Lowercase
Runtime: 59,629 Microseconds
Import parameters Value
DATE1 01.01.2007
TIME1 00:00:00
DATE2 31.12.2007
TIME2 00:00:00
Export parameters Value
DATEDIFF 364 TIMEDIFF 0
EARLIEST 1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Refer the FMs -
SD_DATETIME_DIFFERENCE
C14B_DIFF_BT_2_DATES
But easiest is -
data: v_dat type dats,
v_dat1 type dats,
v_int type I.
v_dat = sy-datum.
v_dat1 = sy-datum - 10.
v_int = v_dat - v_dat1.
write: v_int.
Regards,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
/SDF/CMO_DATETIME_DIFFERENCE
check this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HR_HK_DIFF_BT_2_DATES check this FM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.