‎2007 Jan 19 6:04 AM
hi,
i need to check the current system time is 3.00 or not and if it is 3.00 i need to execute something can u guys plz suggest me how to compare time.
urgent plz.
‎2007 Jan 19 6:11 AM
Hi Ravi
1) create a variable like sy-UZEIT and assign value as SY-uzeit to it ..
2) create another varaible like sy-uzeit and assign ur value i.e '03:00:00' to it.
3) now compare like
if ur_variable = sys_time .
.........
else.
......
endif.
Regards
Chandrika.
‎2007 Jan 19 6:06 AM
hi Ravi,
Make use of <b>SY-UZEIT</b> Variable to compare time ...
it is a 6 character variable which contains values in this fashion i.e, hhmmss...
data : v_hour(2) value '3',
v_time like sy-uzeit.
if v_time+0(2) = v_hour.
endif.
‎2007 Jan 19 6:08 AM
Hi Ravi ,
Current time is in the system field sy-UZEIT , it is in the format hhmmss.
You can check if the time with your said time.
But could you please tell me why you have such a requirement , if you want a program to be exeucted every day at 3:00 hrs you can schedule it in background and the system will take care of it .
Regards
Arun
‎2007 Jan 19 6:08 AM
1) create a variable like sy-UZEIT and assign value as SY-uzeit to it ..
2) create another varaible like sy-uzeit and assign ur value i.e '030000' to it.
3) now compare like
if ur_variable = sys_time .
.........
else.
......
endif.
‎2007 Jan 19 6:08 AM
‎2007 Jan 19 6:10 AM
HI,
You can get the time using the system variable sy-uzeit.
I dont think you want to compare even seconds. so i have coded for only hours and minutes.
DATA: ch(4) TYPE c.
ch = sy-uzeit.
WRITE: ch.
if ch = '0300' or ch = '1500'.
endif.
This should work.
Regards,
Sesh
Message was edited by:
Seshatalpasai Madala
‎2007 Jan 19 6:11 AM
Hi Ravi
1) create a variable like sy-UZEIT and assign value as SY-uzeit to it ..
2) create another varaible like sy-uzeit and assign ur value i.e '03:00:00' to it.
3) now compare like
if ur_variable = sys_time .
.........
else.
......
endif.
Regards
Chandrika.
‎2007 Jan 19 6:11 AM
Hi
Check the SY-UZEIT.
If it is 3.00 then perform the operation
Thanks
Shiva
‎2007 Jan 19 6:14 AM
Hi Ravi
data: g_time type string.
g_time - sy-uzeit.
if g_time EQ 3.00.
<then execute something >
ENDIF.
PLZ REWARD POINTS IF HELPFUL
‎2007 Jan 19 6:14 AM
You can get the system time from sy-uzeit.
Use it to get the time and manipulate as required.
Check the code below:
*&---------------------------------------------------------------------*
*& Report ZMADHU_UZEIT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZMADHU_UZEIT.
data: v_time type sy-uzeit.
v_time = sy-uzeit.
IF v_time(2) ne 3. "Check the hour
WRITE / v_time.
else.
write / 'Time'.
ENDIF.
Regards
‎2007 Jan 19 6:15 AM
hi,
g_hh(2) type c.
g_hh = sy-uxeit+0(2).
if g_hh = '03'
ur case.
endif.
hope this helps