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

need time difference

pankajs_dwivedi
Participant
0 Likes
680

ANy Function which gives back time difference between two date and time in seconds.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
638

Hi,

check this

<b>sorry i changed the thread mistakenly, i will replace it again</b>

sorry check this thread

regards,

sowjanya

Message was edited by: sowjanya suggula

5 REPLIES 5
Read only

Former Member
0 Likes
638

hi try,

<b>SD_DATETIME_DIFFERENCE

SD_CALC_DURATION_FROM_DATETIME</b>

Read only

0 Likes
638

<b>FM "SD_DATETIME_DIFFERENCE"</b>

or

data : date1 type dats , " System data type for Date (sy-datum)

date2 type dats,

time1 type tims, " System data type for time (sy-timlo)

time2 type tims,

days type i,

scd type i,

t_mt type i.

days = date1 - date2. " Diference in days.

Scd = time1 - time2. " diference in seconds.

t_mt = ( days * 24 * 60 ) + ( scd / 60 ).

total diference in minute

Read only

Former Member
0 Likes
639

Hi,

check this

<b>sorry i changed the thread mistakenly, i will replace it again</b>

sorry check this thread

regards,

sowjanya

Message was edited by: sowjanya suggula

Read only

Former Member
0 Likes
638

hi Pankaj,

Check FM SD_DATETIME_DIFFERENCE

CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
    EXPORTING
        DATE1            = D1
        TIME1            = T1
         DATE2            = D2
         TIME2            = T2
    IMPORTING
         DATEDIFF         = D3
         TIMEDIFF         = T3

    EXCEPTIONS
         INVALID_DATETIME = 1
         OTHERS           = 2.

Regards,

Santosh

Read only

0 Likes
638

pankaj plz check th thread before givin points...lol.