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: 

Regarding Function Module

Former Member
0 Kudos

Hi ,

my requirement is i have two dates and times like :

04.10.2008 11:30:00 and 05.10.2008 12:30

hw can i calculate the difference between times ? Is there any function module which fulfill this requirement?

I have already tried the FM 'SD_CALC_DURATION_FROM_DATETIME'

but the problem is hw can i convert the output format to time type , i have given the variable which is of same type like the one used in FM. But i am getting some RunTime error saying unable to interpret '5:00' as a number.

can any one give me solution for this ...

Waiting for ur reply....

Regards

Srinath

5 REPLIES 5

Former Member
0 Kudos

hi Srinath,

Declare a variable of type p (Packed decimal).

Now subtract the two dates and assign the result to this variable. it wil get stored in date format only...

hope ur query is resolved. get back if u need further assistance.

former_member188685
Active Contributor
0 Kudos

check the function

SCOV_TIME_DIFF

Import parameters               Value
 
 IM_DATE1                        2008-01-01
 IM_DATE2                        2008-01-01
 IM_TIME1                        10:00:00
 IM_TIME2                        11:30:00
 
 
 Export parameters               Value
 
 EX_DAYS                         0
 EX_TIME                         01:30:00

Former Member
0 Kudos

hi,

The below function module is quite useful for you.

CCU_TIMESTAMP_DIFFERENCE

Former Member
0 Kudos

This message was moderated.

former_member598013
Active Contributor
0 Kudos

Hi Srinath,

If you are using the TimeStamp then use the below FM

TIMESTAMP_DURATION_DETERMINE

Thanks,

Chidanand