cancel
Showing results for 
Search instead for 
Did you mean: 

calculae difference in dates.

Former Member
0 Kudos

Hi,

My requirement is I have to calculate Diference in dates

Like as,

if net date = 12-04-2008 and issue date = 12-03-2008

term Date = net date - issue date

how to calculate term date.

Any idea with some coding.

Award points for good answer.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

No need for a FM.

Data: days type i.

days = end_date - start_date.

Write:/ days

Or

function module CCU_TIMESTAMP_DIFFERENCE

Regards

Kiran Sure

Former Member
0 Kudos

Hi,

Use FM 'HR_HK_DIFF_BT_2_DATES'

Regards,

Satish

Former Member
0 Kudos

Hi,

You want the difference bewteen two dates as a number of days?

Just use,


DAYS = NET_DATE - ISSUE_DATE.

There are also function modules that will do this, but why bother when it can be done in one line of code.

Regards,

Nick

Former Member
0 Kudos

U can use FM SD_DATETIME_DIFFERENCE if you need to calculate the diffrence in days between two dates.

CALL FUNCTION 'SD_DATETIME_DIFFERENCE'

EXPORTING

DATE1 = '22.04.2008'

TIME1 = '12:00:00'

DATE2 = '23.04.2008

TIME2 = '12:00:00'

IMPORTING

DATEDIFF = DATEDIFF

TIMEDIFF = TIMEDIFF

EARLIEST = EARLIEST

EXCEPTIONS

INVALID_DATETIME = 1

OTHERS = 2.

I hope it helps.

Thanks,

Vibha

Please mark all the useful answers