2007 Dec 19 10:38 AM
Hi SDN,
I have to date fields lv_d1 & lv_d2 i want to find out the comparision or difference between the above two fields.
regards,
Rahul
2007 Dec 19 10:51 AM
u havnt specified ..u want 2 compare 2 dates on wat basis..
den also use this FM HR_99S_INTERVAL_BETWEEN_DATES
to get da difference between 2 dates in days ,weeks and months...
let me knw if it is smthin else
Hope dis helps..
Reward if it does
Hi Rahul,
Try any one of this function modules.
HRVE_GET_TIME_BETWEEN_DATES
CX_SCHED_VIA_OPERATING_TIME
SD_DATETIME_DIFFERENCE
SD_CALC_DURATION_FROM_DATETIME
HR_HK_DIFF_BT_2_DATES
Pllzzz Reward if useful,
Mahi.
2007 Dec 19 10:43 AM
hi
rahul,
data:
lv_int1 type i,
lv_int2 type i.
lv_int1 = lv_d1.
lv_int2 = lv_d2.
lv_int2 = lv_int2 - lv_int1.
wht evere comparision u want u can do basically wht happns is int variables will have the value of no of days so u can compare wht ever u want
plzz reward if u found my answer helpfull to u
2007 Dec 19 10:48 AM
Hi,
1. Difference:
lv_dt2 - lv_dt1 = <Number of days>
2. Comparison:
if lv_dt2 > lv_dt1 .
....lv_dt2 is latest date menas the condition will be true......
endif.
- Selva
2007 Dec 19 10:49 AM
hi,
use this fm /SDF/CMO_DATETIME_DIFFERENCE.
it will solve ur problem.
Reward points if helpful,
Regards,
Sumanjeet.
2007 Dec 19 10:56 AM
Thanks for reply,
but i want the difference between 2 days should be greater than equal to 6 months.
how can i get the difference between two dates in months.
Regards,
Rahul
2007 Dec 19 11:02 AM
Hi,
Use the FM HR_HK_DIFF_BT_2_DATES. In oputput format put value as 04.
Thanks,
Lalit
2007 Dec 19 11:08 AM
Hi Rahul,
Try any one of this function modules.
HRVE_GET_TIME_BETWEEN_DATES
CX_SCHED_VIA_OPERATING_TIME
SD_DATETIME_DIFFERENCE
SD_CALC_DURATION_FROM_DATETIME
HR_HK_DIFF_BT_2_DATES
Pllzzz Reward if useful,
Mahi.
2007 Dec 19 11:10 AM
Hi Rahul,
You can directly compare the 2 date fields.
eg... if di > d2.
else.
lv_diff = d2 - d1. You will get the value in no. of Days. You can divide this value by 30 to get the no. of months.
Lokesh
2007 Dec 19 10:51 AM
u havnt specified ..u want 2 compare 2 dates on wat basis..
den also use this FM HR_99S_INTERVAL_BETWEEN_DATES
to get da difference between 2 dates in days ,weeks and months...
let me knw if it is smthin else
Hope dis helps..
Reward if it does
2007 Dec 19 11:07 AM
hi,
you can use FIMA_DAYS_AND_MONTHS_AND_YEARS
Get number of days. Year, Months between two dates.
regards,
pavan
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |