Application Development 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: 

FM req to cal diff b/t dates & time to give exact time diff in HH:MM:SS

Former Member
0 Kudos

hi

is there any FM exits whcih give the exact diff of time in HH:MM:SS format,b/t 2 dates with 2 times.

like :date1:24.09.2008

time1:12.30.00

date2:23:09.2008

time2:15.00.00

difftime:21.30.00

regds

vipin

9 REPLIES 9

Former Member
0 Kudos

Check the method TD_SUBTRACT of class CL_ABAP_TSTMP.This method returns the result in secs .

Edited by: Joyjit Ghosh on Sep 24, 2008 12:10 PM

kiran_k8
Active Contributor
0 Kudos

Vipin,

For dates:-HR_HK_DIFF_BT_2_DATES

K.Kiran.

kiran_k8
Active Contributor
0 Kudos

Instead of HR_HK_DIFF_BT_2_DATES

use this FIMA_DAYS_AND_MONTHS_AND_YEARS

Former Member
0 Kudos

Hi,

Try the FM SD_CALC_DURATION_FROM_DATETIME

It takes two dates and times, and returns the no of hours and

mins.

Hope this helps you.

Thanks,

Ruthra

Former Member
0 Kudos

Use SD_DATETIME_DIFFERENCE FM to get the date and time difference...

If you want in HH:MM:SS format then just debug the FM and write the code present in this FM so that you will get the required format...

(or)

Use SD_CALC_DURATION_FROM_DATETIME which gives the time difference in HH:MM:SS format...

Former Member
0 Kudos

hi,

refer this thread

GauthamV
Active Contributor
0 Kudos

hi,

use this fm.

SD_CALC_DURATION_FROM_DATETIME .

Former Member
0 Kudos

Hi Vipin,

try the FM's:

SD_DATETIME_DIFFERENCE

Give the difference in Days and Time for 2 dates

/SDF/CMO_DATETIME_DIFFERENCE

Calculates difference between two dates/timestamps.

With luck,

Pritam.

former_member188685
Active Contributor
0 Kudos

Check the Function

SCOV_TIME_DIFF