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

finding number of days between two dates

Former Member
0 Likes
14,305

hi I need to find number of days between two dates. how i can do that in abap.Please let mr know about this.

suppose today date is 20.06.2007 and thr other date is 25.08.2008.

I want to know the no days between two dates.

thanks in advance...

hi I need to find number of days between two dates. how i can do that in abap.Please let mr know about this.

suppose today date is 20.06.2007 and thr other date is 25.08.2008.

I want to know the no days between two dates.

thanks in advance...

3 REPLIES 3
Read only

Former Member
0 Likes
2,425

Try FM HR_HK_DIFF_BT_2_DATES

Thanks,

SKJ

Read only

Former Member
0 Likes
2,425

HI,

Use this.

PARAMETER:p_date1 TYPE dats,

p_date2 TYPE dats.

DATA:lv_diff TYPE i.

CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'

EXPORTING

i_datum_bis = p_date1

i_datum_von = p_date2

IMPORTING

e_tage = lv_diff

EXCEPTIONS

days_method_not_defined = 1

OTHERS = 2.

IF sy-subrc = 0.

WRITE:/ lv_diff.

ENDIF.

Thanks

Mahesh

Read only

Former Member
0 Likes
2,425

Hi,

You can do it in a simple way

Data: Var type i.
Var = Date1 - date2.    " This will give you the difference

Alos you can use the below function modules

DAYS_BETWEEN_TWO_DATES

FIMA_DAYS_BETWEEN_TWO_DATES_2

HR_HK_DIFF_BT_2_DATES

Regards

Sudheer