‎2011 Sep 22 3:59 PM
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
‎2011 Sep 22 4:32 PM
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.
‎2011 Sep 22 4:32 PM
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.
‎2011 Sep 22 4:42 PM
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
‎2011 Sep 22 5:29 PM
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