cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error time is in future

Former Member
0 Kudos

Hi Experts,

When i am trying to post the production order details and confirmation into SAP from MII i am getting the error TIME IS IN FUTURE.

After my investigation SAP time is in GMT and the MII time is in EDT.At the time of posting it is capturing the time from system, so i set my system time with MII time.

Could any one of you tell how to figure out the issue.

Thanks in advance,

Madhusudan.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

my recommendation is:

If possible then work internally in MII with UTC time. Don't trust times coming from users client because they can manipulate the local time and the timezone of his PC!

If the user want to get the time in his timezone displayed then calculate in MII based on UTC + Timezoneoffset and display this result on client screen.

Keep MII Server and SAP system synchronized by a timeserver.

I know this is a lot of work but your customer will be satisfied.

You can get the clients timezone & timezoneoffset by an own applet see this java code:


import java.applet.*;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

/**
 *
 * @author Scorrano
 */
public class ClientHelper extends Applet{
    
    /** Creates a new instance of clientHelper */
    public void init() {
    }
    
    
    public String getTimeZone(){
        TimeZone tz = TimeZone.getDefault();
        System.out.println("User TimeZone = "+ tz.getID());
        return tz.getID();
    }
    
    /*get the offset as an integer from client time to UTC 
     *@return timezoneoffset in miliseconds to UTC
     */
    public int getRawTimeZoneOffset(){
        TimeZone tz = TimeZone.getDefault();
        System.out.println("User getRawTimeZoneOffset = "+ tz.getRawOffset());
        return tz.getRawOffset();
    }
}//end class

if you compiled the source you can add this in your html/irpt page similar to my example:

insert this code snipped to your html page ( due to a limitation about this forum I'm unable to post the correct source code. But I hope you understand this...


<button type=button on_Click=getValuesFromClientHelper()> Show Values from ClientHelper</button>
<applet name="ClientHelper" code="ClientHelper.class"  archive="ClientHelper.jar" WIDTH="1" HEIGHT="1" >
	alt="Please activate your Java Plugin"
</ applet>

and add a javascript function like this :



		function getValuesFromClientHelper(){
		a_lert("TimeZone = "+document.ClientHelper.getTimeZone());
		a_lert("RawTimeZoneOffset = "+document.ClientHelper.getRawTimeZoneOffset());
	}//end

Former Member
0 Kudos

We ran into the same issue. There are 3 things to consider, the time on the MII server, the time on the ECC server and the time zone of the user account that you are using to make the connection.

We solved this problem by running both servers in GMT and setting the user account time settings to GMT.

One another thing to be aware of is to make sure that the server clocks are synchronized.