2015 Jun 25 2:16 PM
dear experts,
My requirement is to not execute one step in the program when the day is Thursday and time is before 1pm. so after 1pm it should execute as usual.
The program runs every 2 hours and on all days.
The problem I am facing is the value I am passing to a time variable is not working.Because with this value I need to compare the system time.
Data : tv_day like scal-indicator,
tv_time type syst-uzeit.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = sy-datum
IMPORTING
day = tv_day. " Here I am getting the value 4 for Thursday
*Now I am passing the time to a variable.
tv_time = 130000. " Here is the problem , the value actually coming to tv_time is 120640.Which is wrong.
*But when I pass tv_time = sy-uzeit , it is taking the correct value.
*Even I tried with keeping the value in single quotes '130000' but not working.
If tv_date eq 4 and sy-uzeit lt tv_time.
Dont execute.
Else.
Execute.
Endif.
Please also tell me is there a better way of writing this code
2015 Jun 25 2:59 PM
2015 Jun 25 2:51 PM
Hi.
You should use this and edit positions of TSTMP (last 6 chars). You convert SY-UZEIT in an editable data and after you can compare with 130000... Timestamp is a standard function
DATA: tstmp LIKE TZONREF-TSTAMPS
.
CALL FUNCTION 'CONVERT_INTO_TIMESTAMP'
EXPORTING
I_DATLO = sy-datum
I_TIMLO = sy-uzeit
* I_TZONE = SY-ZONLO
IMPORTING
E_TIMESTAMP = tstmp
Hope to help
Bye
2015 Jun 25 2:59 PM