Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

calculating dates FM

Former Member
0 Likes
822

Hi friends,

can any one tell me what is the function module for calculating dates ie. difference between 2 dates.

cheers

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
802

CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'

EXPORTING

date1 = lv_date1

date2 = lv_date2

output_format = '02'

IMPORTING

days = lv_days.

regards,

Srinivas

7 REPLIES 7
Read only

Former Member
0 Likes
803

CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'

EXPORTING

date1 = lv_date1

date2 = lv_date2

output_format = '02'

IMPORTING

days = lv_days.

regards,

Srinivas

Read only

Former Member
0 Likes
802

Hi ,

The below function module is useful for ur requirement.Check it once.

CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS' " find the difference between review date and current date.

EXPORTING

beg_da = sy-datum

end_da = v_review_date

IMPORTING

no_day = v_diff_days

no_month = v_diff_months

no_year = v_diff_year

.

Regards

Read only

Former Member
0 Likes
802

Please check if

DAYS_BETWEEN_TWO_DATES is helpful to your case.

Thanks

Read only

Former Member
0 Likes
802

DAYS_BETWEEN_TWO_DATES

Read only

Former Member
0 Likes
802

For calculating differnce between dates

U can simply use.

l_date = dateto  - datefrom.

l_date will give u the difference.

Read only

Former Member
0 Likes
802

Hi,

YOu can use FMs


DAYS_BETWEEN_TWO_DATES 
MONTHS_BETWEEN_TWO_DATES 

Thanks,

Sriram Ponna,

Read only

Former Member
0 Likes
802

Difference b/w 2 dates can be achieved by FM

/SDF/CMO_DATETIME_DIFFERENCE

also check FM

HR_99S_INTERVAL_BETWEEN_DATES

Hope this helps.

Regards

Vinayak