Application Development and Automation 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: 
Read only

add seconds to system timing

former_member227140
Active Participant
0 Likes
7,390

Hello Friends,

here is a question.......i want to add 02 seconds to system time and get into the variable and i am passing that variable to a FM

in my code....

just tell me how to add seconds to current system time..

i have done like this but giving runtime error.

DATA : WA_TIME TYPE IMRG-ITIME

WA_TIME = SY-UZEIT + '00:00:02'

Hello Friends,

here is a question.......i want to add 02 seconds to system time and get into the variable and i am passing that variable to a FM

in my code....

just tell me how to add seconds to current system time..

i have done like this but giving runtime error.

DATA : WA_TIME TYPE IMRG-ITIME

WA_TIME = SY-UZEIT + '00:00:02'

4 REPLIES 4
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
3,941

check class cl_abap_tstmp method ADD & TD_ADD

i think this thread is waiting to get locked

Edited by: ksd on Nov 23, 2009 4:01 PM

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
3,941

Hi,

Refer:


DATA : v_uzeit TYPE sy-uzeit.

START-OF-SELECTION.
  v_uzeit = sy-uzeit + 1.
  WRITE : sy-uzeit, '--', v_uzeit.

Hope this helps you.

Regards,

Tarun

Read only

former_member673464
Active Contributor
0 Likes
3,941

hi,

You can directly add number '2' to it. Time will increase by 2 seconds. try like this.

DATA : WA_TIME TYPE IMRG-ITIME.

WA_TIME = SY-UZEIT + 2.

write: wa_time, sy-uzeit.

regards,

Veeresh

Read only

0 Likes
3,941

Yes you can use sy-uzeit as it gives the Current Time of Application Server. and adding 2(without any quotes) will work fine.

DATA : WA_TIME TYPE IMRG-ITIME.

WA_TIME = SY-UZEIT + 2.

write: wa_time, sy-uzeit.

Hope it will help.

Thanks

Tanmaya Gupta