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

Showing posts with label abap SWI_DURATION_DETERMINE to find duration between two dates. Show all posts
Showing posts with label abap SWI_DURATION_DETERMINE to find duration between two dates. Show all posts

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' .