Google Search - Blog...........

ABAP - Time Difference Between Two Dates - Function Module SWI_DURATION_DETERMINE

REPORT ztest.

DATA : lv_seconds TYPE sytabix .

data: l type i ,
j(10) type c ,
k(12) type c .

parameters:p_date1 type sy-datum,
p_date2 type sy-datum.

CALL FUNCTION 'SWI_DURATION_DETERMINE'
EXPORTING
start_date = p_date1
end_date = p_date2
start_time = sy-uzeit
end_time = sy-uzeit
IMPORTING
duration = lv_seconds.

l = lv_seconds.
j = l / 60 .
k = l / 3600 .

WRITE :/ k ,'hours' .
write:/ j , 'minutes' .
write:/ l ,'seconds' .

2 comments:

  1. Good APP...Keep going.Wish u all gud

    ReplyDelete
  2. how to find no of days between two dates ..with (eg : +12 or -12 days). I mean future days is + and past date is -ve.
    please help me how to calculate.
    Thanks in advance .plz reply to this mail id.
    satishkumar.darisi@tcs.com

    Warm Regards,
    satish darsi.

    ReplyDelete