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

Function Module to find the Difference between two times.

Former Member
0 Likes
1,225

Hi All,

Wud you plz let me know the Function Module to find the Difference between two times.

Input Time1( Hours:Minutes) Time2 ( Hours:Minutes)

Need Output in Hours:Minutes only . ( No seconds Needed )

Ex :

Input :

06:00 to 18:00 Output : 12:00

and 20:00 to 06:00 Output: 10:00 with +ve sign only. No -ve sign.

Thanks,

N.L.Narayana

6 REPLIES 6
Read only

Former Member
0 Likes
783

hi Narayana,

Check

SD_DATETIME_DIFFERENCE

Regards,

Santosh

Read only

0 Likes
783

Hi

It was not meeting the requirement what i have asked.

Thanks,

N.L.

Read only

dani_mn
Active Contributor
0 Likes
783

HI,

try the following FM

<b>SCOV_TIME_DIFF_46B</b>

Read only

Former Member
0 Likes
783

Hi HRA,

Thanks . its working.

Thanks,

N.L.Narayana

Read only

amit_khare
Active Contributor
0 Likes
783

Hi,

Use anyone of the following but some calculation do require for exact result.

'COPF_DETERMINE_DURATION'

SD_DATETIME_DIFFERENCE

L_MC_TIME_DIFFERENCE

Regards,

Amit

Read only

Former Member
0 Likes
783

check this .

data : p_timel like sy-uzeit,
       p_timeh like sy-uzeit,
       diff like sy-uzeit,
       di(8) type c .
   
       p_timel = '200000'.
       p_timeh = '060000'.
       diff = p_timeh - p_timel.
       concatenate diff+0(2) ':' diff+2(2) into di.
       write:/ di.

also check for this.

p_timel = '060000'.

p_timeh = '180000'.

see if this can be implemented in ur code .

or else u can try with Fm L_TO_TIME_DIFF passing startdate enddate starttime endtime with UOM as MIN

.

hope this helps regards,

vijay