Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

time increase

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

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.

0 Kudos

ztime = ztime + 7200.

what does this 7200 means, is it hours or minutes or seconds.

0 Kudos

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

Former Member
0 Kudos

Hi,

Use FM 'C14B_ADD_TIME' for time calculation.

Regards,

Lalit

Former Member
0 Kudos

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 ).

former_member386202
Active Contributor
0 Kudos

Hi,

USe FM DIMP_ADD_TIME

Regards,

Prashant