cancel
Showing results for 
Search instead for 
Did you mean: 

calculating the difference between two dates

Former Member
0 Kudos

am trying to calculate the number of days between two dates. I called the function module 'DAYS_BWTEEEN_TWO_DATES' Then I find the result from the function module is not always correct. I searched for the customer message and find that it is a common problme because the function module is not released to the customer yet.

Is there any othere function modules I can use to do the calculation?

Thanks a lot,

Jennifer

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Why not just subtract the two dates in ABAP?

data: w_d1 like sy-datum,

w_d2 like sy-datum.

data: w_diff type i.

w_d1 = '20060131'.

w_d2 = '20051225'.

w_diff = w_1 - w_2.

write : / w_diff .

Former Member
0 Kudos

Emmanuel:

Thank you for the answer. It resovled the issue.

Jennifer

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I heard of an option of doing this by using 'Virtual Key Figures'.

Regards

Former Member
0 Kudos

Hi,

That is the only function module as far I knew. You can create your own fnction module based upon the logic available in the existing one.