hi Kamal,
First, in the DSO, we will create a Time type of KF InfoObj. as you suggested. Then in the Transformation from PSA to DSO, for this KF InfoObject, in the field routine, we would use the function suggested by Raf to calculate the time difference and assign the value into this KF InfoObj. and eventually total time difference will be calculated automatically as a result when running the query. Then we don't understand what you say about "use this in Bex and restrict with user input variable using replacement path.", what are your points? Is it necessary?
Thanks!
Kevin