Tuesday, May 6, 2008

Sample ABAP Program to Calculate difference between date/times in hours

DATA: l_start TYPE t,
l_end TYPE t,
l_startdate TYPE d,
l_enddate TYPE d,
l_hours TYPE p DECIMALS 2.

l_start = p_starttime.
l_end = p_endtime.
l_startdate = p_startdate.
l_enddate = p_enddate.

l_hours = ( ( l_enddate - l_startdate ) * 24
+ ( l_end - l_start ) / 3600 ).

No comments:

Blog Archive