cancel
Showing results for 
Search instead for 
Did you mean: 

timestamp incrementing in abap

Former Member
0 Kudos

Hi All,

I want to increment the 15 digit timestamp say 20090603093000 in abap code or 20.090.603.093.000 as in table which is taken has year 2009 month 06 june, date 03,hour 09,minute 30 and second 00 by a hour each time in a loop and then search in a table whether that timestamp has an entry in a table.I want to know how I can increment this timestamp. If anyone has worked on it or have any idea about it, please guide me.

Thanks and regards,

Kavya k

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi Kavya,

This can be done using methods of BASIS class(APIs) cl_abap_tstmp. There are methods like SUBTRACTSECS to subsbract seconds from timestamp, TD_ADD to add seconds to date & time.

Using these if you want to add seconds to DATE & TIME, convert first it into timstamp(using apis of same class), use those methods to add seconds and then convert timestamp back to date & time. This way any of these kind can be solved.

Regards,

Manne.

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

This question is not appropriate for the WDA forum. There is nothing WDA specific about. In the future please place such questions into the ABAP General forum.

former_member230839
Participant
0 Kudos

Hi kAVYA,

Please use the function module TIMESTAMP_DURATION_ADD to increment the timestamp.

regards,

Anil kumar G