on 12-31-2009 9:30 AM
Hello Experts,
I am using JCO to call an RFC from java.
One of the returned fields is a timestamp.
When I invoke the RFC from within the SAP system, I get a correct timestamp value.
But, when I invoke the RFC using JCO, the timestamp value returned has less 2 hours.
Does anybody know what might be the reason for that?
Regards,
Effi.
A GMT problem synch.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>Please check the Date and time stamp of SAP server from where you are getting this time.
Hello Puneet,
Thanks for your reply. I got around to this issue again and it is still confusing me. I have provided snapshots of 2 different SAP systems where I am seeing this 'issue'. Both Systems are in windows boxes.
1.)
CTS
====
Box time 14:01:57 (19/3/2007 - for testing)
Sap time 09:31:57 (sap system time)
Diff time = 4:30 hrs
User Timezone CET (UTC+1)
Box timezone IST (UTC + 5:30)
System Timezone CET
alert monitor timestamp values obtained using jco client = 1 hr + corresponding timestamp seen using sapGUI
2.)
NSP
===
Box time 14:27:38 (29/4/2011)
Sap time 10:57:38 (sap system time)
Diff time = 3:30 hrs
User timezone CET
Box timezone IST (UTC + 5:30)
System timezone CET
timestamp from jco
alert monitor timestamp values obtained using jco client = 2 hrs + corresponding timestamp seen using sapGUI
CTS system, which is NW 04 with Java, uses Oracle RDBMS and NSP system which is NW 7.01 with ABAP, uses a Max DB backend. Both systems seem to have the same timezone settings (but different box times). Given that 'diff time' is the difference between box time and sap system time, I am assuming the difference between the 2 systems is because CTS is in Central European Standard Time (GMT + 1) and NSP is in Central European Summer Time (GMT + 2)
So, when I get timestamps from CCMS alert monitor using a JCO client, is it correct that all these timestamps will be in UTC only and I have to get the user timezone and convert each timestamp to the JCO user's timezone?
Even if that is the case, how would I go about getting the user's timezone? I heard about the system fields sy-timlo, sy-datlo etc., but I only know about the method MSS_GET_SY_DATE_TIME which get the SYSTEM date and time. Are there other functions that can help me get USER related fields like sy-timlo, sy-datlo, sy-tzone etc.? I want the timestamps in my JCO code to eventually match what I see in alert monitor using sapGUI.
Please help!
-Arvind
Edited by: ArvindKrish on Apr 29, 2011 2:07 PM
Hi
What do you mean by the statement "less by 2 hrs'.
Try to print the returned value of the model node to see wht value RFC is returning.
Regards
Vineet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Add the following method to your WD application and call it
private String getDate() {
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss.SSS");
return (sdf.format(cal.getTime())).toString();
}
Do you see the correct hour?
If not check the date & time on the OS of the J2EE
Also, check the timezone in the Java parameters of the J2EE (in config tool).
Regards,
Omri
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.