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

Issue with TIME..

Former Member
0 Likes
538

Hi,

As we know that the integer value fo the full day is 86400, which is converted into integer.

Like this, I want to convert the time to integer value.

For example 09:52:52. I want to convert it into integer value.

and then convert it back to HH:MM:SS format.

Is it possible?

Later I want to use this integer value as part of index along with date.

I am not a ABAP champion so please advice if I am going in to wrong direction.

Regards,

SC

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
501

Hi

Try below code


data: v_time type i,
      v_stime type sy-uzeit.

parameters:     p_stime type sy-uzeit default sy-uzeit.

v_time = p_stime.

v_stime = v_time.


write : v_time, v_stime.

3 REPLIES 3
Read only

Former Member
0 Likes
502

Hi

Try below code


data: v_time type i,
      v_stime type sy-uzeit.

parameters:     p_stime type sy-uzeit default sy-uzeit.

v_time = p_stime.

v_stime = v_time.


write : v_time, v_stime.

Read only

Former Member
0 Likes
501

Hi

The date can be converted into integer number, because it can calculate the number of days from an initial date (I'm not sure, but I think it's 01/01/0001

But this concept is not valid for the time, because the values are cyclical: they are repeated for every day, from 0 to 24.

So if you need to create an unique index it's enough you concatenate the date and time together,

The interger value of the time will be the time, I mean the integer of 09:52:52 will be 95252

So you can use the time without to convert it.

Max

Read only

0 Likes
501

Thank you both for the reply.

I just used type integer and type time as suggested and ABAP took care of the rest of the conversion.

Regards,

SC

Edited by: Sume on Sep 22, 2011 6:29 PM