‎2007 Dec 27 4:48 PM
All,
I wanted to add the hours into Time field. For example:
I have the Time 083000 (HH:MM:SS) & number of hours 4.30 (This may vary at runtime). I wanted to add the 4.30 into 083000. How can i do that?
BM
‎2007 Dec 27 4:52 PM
Use this FM
C14B_ADD_TIME
Importing
I_STARTTIME 08:30:00
I_STARTDATE
I_ADDTIME 04:30:00
-Pavan
‎2007 Dec 27 4:52 PM
Use this FM
C14B_ADD_TIME
Importing
I_STARTTIME 08:30:00
I_STARTDATE
I_ADDTIME 04:30:00
-Pavan
‎2007 Dec 27 4:55 PM
Thanks. but in my case the format is 4.30 not 04:30:00. I cant use this FM.
BM
‎2007 Dec 27 4:56 PM
I did a similar for dates with months check it might be helpful
IF pa_older = 'X'.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = pa_end
days = '00'
months = '06'
signum = '-'
years = '00'
IMPORTING
calc_date = pa_end.
ENDIF.
‎2007 Dec 27 4:58 PM
Hi,
You can use FM CATT_ADD_TO_TIME.
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.
‎2007 Dec 27 5:09 PM
sriram,
if i use stdaz = '4.30' the output is not correct. Can you help me?
BM
‎2007 Dec 27 5:19 PM
Hi,
I am getting exact result as expected.
Can you please go to se37 and test the FM, you can find it.
Thanks,
Sriram Ponna.
‎2007 Dec 27 5:44 PM
ok i wanted to add 4 hours 30 mins to the TIme 08:30:00. I get the output as 12:36:00. I suppoed to get 13:00:00.
Hope this is clear.
BM.
‎2007 Dec 27 5:56 PM
‎2007 Dec 27 6:05 PM
Hi,
I can see the issue, I donno why it showing 12 seconds less.
Sri.
‎2007 Dec 27 6:09 PM
‎2007 Dec 27 6:25 PM
Hi,
I donno how far i am correct, after analysis I found below :
I think 4.30 mins means 4 and half hours. In general we will write it as 4.5. In the code I have give if you change it to 4.5.
Similarly for 4.15 mins we can write it as 4.25(quater of 60 mins) 4.25 you will get 4:15 mins.
You will get the exact result.
I may be wrong in this case, just do analysis with the above.
Thanks,
Sriram Ponna.
‎2007 Dec 27 7:01 PM
All,
I solved with below logic:
+SPLIT V_STR AT '.' INTO V_MIN V_SEC.
IF STRLEN( V_MIN ) = 1.
CONCATENATE '0' V_MIN INTO V_MIN.
ENDIF.
CONCATENATE V_MIN V_SEC '00' INTO V_HRS.
T_TIMES = V_HRS.
TO_TIME = FROM_TIME + T_TIMES.+
Thanks for all your help.
BM