12-21-2007 5:26 AM
Hi,
in one of my select statement I say
date of creation as = sy-uzeit.
so it takes the system time, so when it takes system time I want to add 2 more houres to that time
sy-uzeit + 2 hours ,
so how can it be done.
12-21-2007 5:29 AM
Hi,
u can simply add one to time and it will be incremented by one second.
data ztime type sy-uzeit.
ztime = sy-uzeit.
ztime = ztime + 7200.
12-21-2007 5:35 AM
ztime = ztime + 7200.
what does this 7200 means, is it hours or minutes or seconds.
12-21-2007 5:37 AM
Hi,
ztime = ztime + 7200.
what does this 7200 means, is it hours or minutes or seconds.
In this 7200 is the number of seconds in 2 hours. But it would be good if you use FM for any Date or Time Calculation.
Regards,
Lalit
12-21-2007 5:33 AM
12-21-2007 5:35 AM
Hi,
Before adding the value to time, we should convert it into hours. i.e., multiply the value with (60 (sec) * 60 (min) )
l_f_val = 2. ( 2 hours to be added)
l_f_val = l_f_val * 60 * 60.
result of l_f_val = 7200.
Then add the value to sy-useit value.
l_f_time = sy-uzeit.
l_f_addtime = 2.
l_f_time = l_f_time + ( l_f_addtime * 60 * 60 ).
12-21-2007 5:49 AM