09-19-2006 8:08 AM
Hi,
I am trying to pick up the system time and date into a variable as follows.
DATA: v_uzeit type sy-uzeit.
v_uzeit = sy-uzeit.
I have written this code in a function module and in debug mode I am not able to get the system time in the variable.
Please provide pointers.
Thanks in advance,
Regards,
Amit Deshpande
09-19-2006 9:32 AM
Hi Amit
I have tried your code and it works fine for me in debug mode. Are you absoutley sure that it is not working i.e. you don't have similar named variables that are causing confusion? When you say you are not getting the system time are you geting any errors or is it just that the variable is blank? What is the sy-subrc value after the assignment?
Kind regards
Andy
Message was edited by: Andrew Wright
Actually, Anver raises a valid point, sy-uzeit is the current application server time while sy-timlo is your local time - make sure you are using the correct one!
09-19-2006 9:26 AM
09-19-2006 9:30 AM
09-19-2006 9:32 AM
Hi Amit
I have tried your code and it works fine for me in debug mode. Are you absoutley sure that it is not working i.e. you don't have similar named variables that are causing confusion? When you say you are not getting the system time are you geting any errors or is it just that the variable is blank? What is the sy-subrc value after the assignment?
Kind regards
Andy
Message was edited by: Andrew Wright
Actually, Anver raises a valid point, sy-uzeit is the current application server time while sy-timlo is your local time - make sure you are using the correct one!
09-19-2006 9:37 AM
09-19-2006 9:43 AM
Hi Andrew and Nishant,
Thank you for the reply.
The sy-subrc is returning zero as the v_uzeit and sy-uzeit are having blank values.
I am confused as to why sy-uzeit is taking blank values.
Also i tried to write a REPORT and it gives me right value of sy-uzeit. Its only in my FM that is it fails.
Regards,
Amit
09-19-2006 10:01 AM
Hi Amit,
Just to confirm two things,
can you check if in debug the syst table fields are having values or not. basically for sy-timlo.
I am not very sure since uzeit is application server time so it should have been there.
Regards
Nishant
09-19-2006 10:11 AM
Hi Amit
I have just created a FM that does nothing except assign sy-uzeit to v_uzeit and when called from another program it works fine. In Debug both the system field and the variable contain data. I can't understand why your system time would be blank in the FM and be OK in your program. How big is your FM, could you post it here for us to review?
Kind regards
Andy