cancel
Showing results for 
Search instead for 
Did you mean: 

Activity list in HH shows wrong time (difference of 2 hours)

Former Member
0 Kudos

Hi all.

I'm facing the last (I hope) problem in striving to have an Activity created correctly through a Web Service.

When I turn to the GUI/WebGUI to see my brand new Activity just created I see that everything is ok excepted the Hours of the two timestamps I've set to record the date: years, months, days and minutes are ok, the Hours are in advance of two hours (for example: I've set 1:00, I've got 3:00).

If I try to set a specific TimeZone I do not get any difference: if I try to set a fantasy Time Zone (say: CICCIO) the system recognizes it as an error and discards the timestamp (setting a default one in substitution); if I try a Time Zone that is recorded in the TTZZ table (as UTC+2, INDIA, etc.) no errors are raised, but the Activity is recorded with the very same hour (two hours in advance of the value in the timestamp) without any relationship to the Time Zone.

Debugging I follow everything till the Web Service invocation and I can see that the timestamps are correctly exported to the WS.

The system version is BBPCRM release 700 level 0006. Looking through the SAP notes I've found two ones that seem relevant (622099 and 622364, the latter one seems to me more appropriate than the former) but both refer to release 400...

Has anyone any idea?

Thank you in advance.

Alessandro

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Q1: What is timezone of server? and what is your timezone (consumer application)?

Generally timestamp is in UTC format and calling application convert it to respective timezone.

Regards,

Gourav

Former Member
0 Kudos

Thak you Gourav, just for your interest!!!

I'm quite sure we (client and server) are in the same Time Zone (it should be CET):

1) if I look at the System time in the SAP GUI I see the same time I've got in my PC;

2) if I change the Time Zone of my PC (say I take it in advance of 4 hours) I keep seeing that the System Time remains in the previous time zone (displaying the correct CET time);

3) if I create an appointment from SAP GUI the dates have a time set by default to current time according to System Time Zone (CET).

Keeping my PC Time Zone altered I've created an Activity through the Adobe (invoking the Web Service), having left blank the Time Zones, and the appointment is created with the dates time set two hours in advance of the face value time I've set in the form (i.e.: nothing has changed, the quirk remains).

Does it help you (to help me)?

Regards,

Alessandro

Former Member
0 Kudos

Hi Alessandro,

This make sense, as stated in my previous post timestamp is in UTC format and your system time is in CET which is UTC+2 (nothing to do with your PC time, you can see system and user timezone in SU01->Defaults).

So when you post time using service you send time in UTC format which is 2 hours behind CET time.

In GUI user enter time as specified in his profile timezone or system timezone and ABAP program usually convert this into UTC time so behavior of SAP GUI is different than service.

So next time if you want to supply date then please adjust according to UTC +/- your timezone.

Code from SAP help:

CONVERT TIME STAMP time_stamp TIME ZONE tz 
        INTO [DATE dat] [TIME tim] 
        [DAYLIGHT SAVING TIME dst].

You can also see detail in SAP help in SE38

Regards,

Gourav

Former Member
0 Kudos

Hi Gourav

I supposed something similar, but I've been disoriented by the fact that the system ignores the Time Zones I'm explicitly setting in the form: the web service provides explicit attributes to set Time Zones for the passed date/times, and It does check them (to see if they are registered in the TTZZ table, discarding the timestamp altogether if no entry is found) but it does also ignore them (you can set whatever you want is registered in the TTZZ and the time set is assumed to be, as you are telling me, UTC).

What am I missing? It's clear that I'm not giving the correct meaning to those Time Zone attributes: what are they meant to?

Regards,

Alessandro

Edited by: Alessandro Canevese on Oct 19, 2010 10:05 AM

Former Member
0 Kudos

Hi,

Is this timezone is attribute of timestamp in service (can you give me service name if it is standard one and available in ES workplace). I think you should check table if time is saved as date/time/timezone or as timestamp.

In your previous question you changed default datatype ACTActPln to something else, this issue (ignoring timezone) could be by product of that change,

Regards,

Gourav

Former Member
0 Kudos

Hi Gourav

I've copied and slightly modified the APPTACTCRTRC object (I've operated through the CRM Web Interface, Service Operations/Web Service Tool).

The modification has simply been (Select Attributes step) to add in the BTHeaderDatesSet group the attributes regarding the date type BTDate_T_ORDERPLANNED: for that date type I've chosen the attributes whose BOL Technical names are TIMESTAMP_FROM, TIMESTAMP_TO, TIMEZONE_FROM and TIMEZONE_TO.

So, in the Adobe IF, I've used those date/time fields (and timezones), instead of those belonging to the BTDate_T_ACTActPln date type group.

Have I explained properly?

Regards,

Alessandro

Former Member
0 Kudos

Hi Gourav.

I can add here further elements from the execution of CRM_ORDER_READ, passing the object ID of the Date just created.

Displaying the ET_APPOINTMENT sub-structure I can see that the each time value is exactly what I've put in the form, with TimeZone CET. The same Date Activity (looked at through the SAP GUI or Web GUI) appears, as usual, with each time shifted two hours in advance.

If I set a different registered TimeZone, I can see that in the ET_APPOINTMENT there are no differences (timestamps remain unaltered and timezones remain CET).

If I set a TimeZone not registered in the TTZZ table, I can see that timestamps get a default value: for example the date part of the "timestamp from" is the current day and the time part is shifted exactly two hours in the past (the net effect is that, through the GUI, the date and time values appear as "now").

I've double checked through su01 that my userid has no personal timezone set (whereas the system time zone is CET; I've also tried explicitly setting the personal time zone to CET either, with no effects).

Regards,

Alessandro

Former Member
0 Kudos

Hi,

I don't have access to CRM so can't recreate your scenario but my understanding is that timestamp will store in UTC format along with timezone to identify correct local time for appointment (including timezone rules).

Now question is why timezone is always CET (say default timezone of system)? perhaps service is not working as it suppose to work but again why?

Can you try following:

- Create appointment from GUI using different timezone (say PST) and check if it is stored correctly, so that we can eliminate any issue with CRM customization,

- Create another user with different timezone and use it to check appoinments to see if there are any changes based of different timezone on UI.

May be you can try to post this issue in CRM forum and someone there already know the solution of this.

Regards,

Gourav

Former Member
0 Kudos

In effects, in the meanwhile, I've found something that could be asked indeed in the CRM forum: if I create an Appointment from SAP GUI (or through the Web GUI), the Report from CRM_ORDER_READ shows that the timestamps have been shifted two hours in the past... So, the GUI is consistent when reading an appointment it has created by itself: it shifts the timestamp by two hours in advance and the net result is that the two shifts cancel each other.

Now I'll go further through this line of investigation.

I thank you a lot anyway for the kind support!!! I'll let you know what comes out.

Regards,

Alessandro

Former Member
0 Kudos

Hi Gourav.

Ok. Maybe I've solved the arcanum.

I've set UTC as the personal time zone of the user I'm using to submit the Adobe Forms.

And through the CRM_ORDER_READ I can see that UTC is effectively recorded (as it is if I set, say, INDIA).

And then it works, because the GUI, seeing that the timezone is UTC, leaves the timestamp as it is.

So, it seems to me that here there may be one "malfunction":

the time zones attributes you submit through the Webservice are ignored (superceded by the personal time zone of the userid used to authenticate the transaction).

Obviously I may be wrong (given my SAP experience it's more probable that I'm wrong than that I'm correct).

Should I open a OSS Note?

Regards,

Alessandro

Edited by: Alessandro Canevese on Oct 21, 2010 3:32 PM

I've removed the GUI "possible malfunction" as I can imagine that the GUI converts the timestamps in UTC format and then it saves the original time zones; when it reads a timestamp, it assumes it's UTC and then trasforms it according to the saved time zone attribute.