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

FM for Timestamp calculation

Former Member
0 Likes
2,655

Hello everyone,

does anyone knows if there is a FM that calculates timestamp time additions?

I have a timestamp ( using CONVERT ..... INTO TIMESTAMP) i want to add to the timestamp value, some minutes

Example: timestamp = 20070816220000 and i want to add 15 minutes to this value. I tried :

1) add 15_minutes to timestamp - if i do this inside a DO ...ENDDO

the timestamp value get's wrong at some point.

20070816226000 + 15m = 20070816229000 instead of 20070816231500

2) i also try to use CONVERT ..... INTO TIMESTAMP with the modified minutes (already added ) inside the loop, but couldn't control the passage from 20070816235959 to 20070817000000, because the date didn't change to 17, it begins again from 20070816000000 day 16.

Can anyone help please,

Best Regard's,

Pedro

Pedro Rosa

null

null

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,921

Hi Pedro,

Use the function module <b>ADDR_ADD_TO_TIMESTAMP</b> to add seconds to timestamp. This function module adds time in seconds.

Thanks,

Vinay

Hello everyone,

does anyone knows if there is a FM that calculates timestamp time additions?

I have a timestamp ( using CONVERT ..... INTO TIMESTAMP) i want to add to the timestamp value, some minutes

Example: timestamp = 20070816220000 and i want to add 15 minutes to this value. I tried :

1) add 15_minutes to timestamp - if i do this inside a DO ...ENDDO

the timestamp value get's wrong at some point.

20070816226000 + 15m = 20070816229000 instead of 20070816231500

2) i also try to use CONVERT ..... INTO TIMESTAMP with the modified minutes (already added ) inside the loop, but couldn't control the passage from 20070816235959 to 20070817000000, because the date didn't change to 17, it begins again from 20070816000000 day 16.

Can anyone help please,

Best Regard's,

Pedro

Pedro Rosa

null

null

6 REPLIES 6
Read only

Former Member
0 Likes
1,922

Hi Pedro,

Use the function module <b>ADDR_ADD_TO_TIMESTAMP</b> to add seconds to timestamp. This function module adds time in seconds.

Thanks,

Vinay

Read only

0 Likes
1,921

Hi thanks Vinay ,

but in 4.6c there's no FM with that name.

Best regard's

Read only

0 Likes
1,921

use methods of this class


CL_ABAP_TSTMP

does this exist or not..

cheers

A

Read only

0 Likes
1,921

Hi,

thanks,

sorry but it doesn't exist in 4.6c!!!!

Best regards

Read only

0 Likes
1,921

Try this FM

CONV_UTIL_ADD_DATE_AND_TIME

Read only

0 Likes
1,921

It work finned, thanks !!