‎2008 Aug 18 9:49 AM
Hi,
In my smartform, I am using a field MKPF-CPUTM. This field is to display the time.
I need to add 6 hours to this value.
Eg :- If MKPF-CPUTM = 09:00:00 hrs. Then I need to display it as 15:00:00 hrs.
Please help me in this regard. Thanks!.
‎2008 Aug 18 10:00 AM
Hi,
DATA:time LIKE mkpf-cputm VALUE '090000'.
DATA:ADD LIKE mkpf-cputm.
add = '060000'.
time = time + add.
WRITE:/ time.
‎2008 Aug 18 9:58 AM
Try FM SD_DEL_WAVE_SUBTRACT_TIME
Hope this helps!
Regards,
Prashant
‎2008 Aug 18 10:00 AM
Hi!
DATA: lv_mytime LIKE MKPF-CPUTM VALUE '060000'.
ADD lv_mytime TO mkpf-cputm.
Regards
Tamá
‎2008 Aug 18 10:00 AM
Hi,
DATA:time LIKE mkpf-cputm VALUE '090000'.
DATA:ADD LIKE mkpf-cputm.
add = '060000'.
time = time + add.
WRITE:/ time.
‎2008 Aug 18 10:09 AM
Hi U can directly add the hours by multiplying the hours with 3600.
eg
PARAMETERS: hr(2) TYPE c.
DATA: tim TYPE mkpf-cputm VALUE '090000'.
tim = tim + ( hr * 3600 ).
WRITE tim.
But make sure to take care of date as well when u add the time.
U can try the FM SD_DEL_WAVE_ADD_TIME as well.
Thanks,
Vinod.
Edited by: Vinod Reddy Vemuru on Aug 18, 2008 2:40 PM
‎2008 Aug 18 10:27 AM
Hi All,
Thanks a lot for the replies. The issue is solved. The answer from Vishnu, helped me to solve the problem in a easy way.
I thank everyone once again.