‎2008 Mar 14 10:45 AM
I am trying to total a list of hours.
Adding 2:20 to 2:57 using the statement add a to b gives me a total of 4:77 rather than the expected 5:17 because it is treating the numbers as decimals rather than hours.
The variables are declared like fahztd.
I have tried using fm C14B_ADD_TIME. This is fine unless the total of the two fields is over 24 hours. ie if I add 12:00 + 13:00 it returns 1:00.
‎2008 Mar 14 10:56 AM
‎2008 Mar 14 11:00 AM
I can't find DIMP_ADD_TIME. Is this new to later versions than 4.7?
‎2008 Mar 14 11:01 AM
Consider this option.
REPORT yptc_goof3 .
DATA:
s_time LIKE sy-uzeit,
e_time LIKE sy-uzeit,
a_time LIKE sy-uzeit,
s_date LIKE sy-datum,
e_date LIKE sy-datum,
e_days TYPE p.
s_time = '022000'.
a_time = '235700'.
s_date = '00010101'.
CALL FUNCTION 'C14B_ADD_TIME'
EXPORTING
i_starttime = s_time
i_startdate = s_date
i_addtime = a_time
IMPORTING
e_endtime = e_time
e_enddate = e_date.
e_days = e_date - s_date.
WRITE:/ 'Days', e_days, 'Hours', e_time.
Out put is :
Days 1 Hours 02:17:00
‎2008 Mar 14 11:04 AM
‎2008 Mar 14 11:29 AM
HI,
data : time like sy-uzeit.
CALL FUNCTION 'CATT_ADD_TO_TIME'
EXPORTING
idate = sy-datum
itime = sy-uzeit
stdaz = '4.00'
IMPORTING
* EDATE =
ETIME = time
.
Thanks,
Sriram Ponna.