My own Function-Module to calculate duration between 2 dates and 2 times
I was searching for a function module that should calculate the duration of 2 tasks .
As result I need values separated into
Most standard function deliver only one(1) result and than this return value is from type F (floating number, like 2,34546787E-03) and I did not want to convert the result into integer. Other standard functions look like they could work, but when I checked them I found that they where calculation wrong!
So I came to the conclusion to copy+paste what ever I can and I wrote my own function module using the SAP function module ‘L_TO_TIME_DIFF’
Here it is (check attachment)
Please comment if you find a BUG, I will try to solve it.
I found and error and replaced attachment/coding…
another bug found (seconds where wrong when time_to < time_from)
next bug with time (seconds where wrong, when date_to = date_from AND time_to < time_from) 😛