‎2008 Sep 25 7:01 PM
Hi All,
I have one problem in time comparison.I am comparing time between two variables.In onr variable time has come from database table in 1200000 pattern i.e without colon and spaces.
And in other variable it is 12:00:00 format.
Now i have to format this 12:00:00 variable so that it comes like 120000.
Please suggest ways to do it.
Thanks in advance,
saket
‎2008 Sep 25 7:06 PM
Hello,
TRANSLATE v_time USING ': '.
CONDENSE v_time NO-GAPS.
Regards.
‎2008 Sep 25 7:09 PM
You can try like this:
data: l_time(8) type c.
l_time = '11:55:12'.
replace all occurrences of ':' in l_time with ' '.
condense l_time.
write: l_time.
Regards,
Naimesh Patel
‎2008 Sep 25 7:11 PM
Hi,
Try this code:
REPORT z_demo_jg1 LINE-COUNT 10(2) NO STANDARD PAGE HEADING.
data: l_time(6) type n.
l_time = '12:00:00'.
write: l_time.
‎2008 Sep 25 7:23 PM
Check this code:
Report ztest.
parameters:
p_time1 type tims, " Eg 12:00:22
p_time2 type c length 6. " Eg 112023
data:
v_temp type tims,
v_difference type tims.
v_temp = p_time2.
v_difference = p_time1 - v_temp.
write: /1 v_difference.
output :
00:39:59
‎2008 Oct 13 7:06 AM