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

time addition

Former Member
0 Likes
783

hi all,

i want to add 2 times, i.e. if 12:00:00 hrs and 13:00:00 hrs

then its giving me 01:00:00.

Because after 24:00:00,time gets reset.

But i want the time 25:00:00 hrs.

Can i do that.

Thanks in advance.

7 REPLIES 7
Read only

Former Member
0 Likes
731

If your variable is of time then its not possible.

Still if you require that then change the type of the variable.

Regards,

Atish

Read only

0 Likes
731

but does it not set some sort index maybe sy-tabix or something to indicate that it did go once or twice beyond the 24.00.00 hr mark...??

Read only

0 Likes
731

Hi,

No. I don't think it store any result or index in any of the system field.

Regards,

Atish

Read only

Former Member
0 Likes
731

Hi tatvagna,

By ABAP standards it is not possible,because u can view the time for 1 day not for the week or month.

Logically u think that it is not possible.

Thanks

Sanket.

Read only

Former Member
0 Likes
731

I know its not possible but can u tell me alternative.

Do u know the function which calculates the time in days and hrs.

Read only

Former Member
0 Likes
731

Hi ... friend here is the program just execute it and see ...

report asda .
tables  : syst .
parameters :   time1 like  syst-uzeit ,
               time2  like  syst-uzeit .

data :   time3 TYPE  STRING ,time4  TYPE  STRING,time5  TYPE  STRING.

time4  = time1 .
time5  = time2 .

time3  =   time4  +  time5  .


write /(10)  time3 USING EDIT MASK'__:__:__'.

output is

<b>12:00:00

13:00:00

25:00:00</b>

reward points if it is usefull.....

Girish

Read only

0 Likes
731

Hello All,

Finally what i am doing is converting the time in seconds, and then adding all the time in seconds and then converting it back to hrs and mins as required....

Thanks to all for the help.

Sorry but this time couldn't find anyone's approach helpful.

Thanks,

Tatvagna.