Skip to Content
avatar image
Former Member

EM OData DateTime Time Zone

We are using the EM OData service to retrieve event handlers for freight orders out of SAP TM. That works fine. However, the format of the event date/time values are not clear to me.

I reported some events for a freight order directly through the TM Transportation Cockpit. My time zone there is set to CET. What confuses me right now, are the resulting values in OData (/FreightOrderEventHandlerDetails):

<d:EventDateTime>2015-10-28T14:12:00Z</d:EventDateTime>


suggests the event was reported at 13:12:00 CET, as a trailing Z indicates the UTC time zone. But in fact it was not. The correct time is 14:12:00 CET, which is exactly what I entered in the Transportation Cockpit. But there is also the EventTimeZone field:

<d:EventTimeZone>CET</d:EventTimeZone>




So maybe the service doesn’t care about the Z pattern at all, if a separate time zone field is provided.

Because then again, there is also this – correctly – added to every entry:

<updated>2015-10-28T13:13:11Z</updated>


That’s the time I saved my changes in Transportation Cockpit.

So what should I do to use the times provided via OData in a UI5 app and display the values according to the user's local time zone? Check if there is a separate time zone field and manually convert the date/time value, according to a custom time zone table, as the path /TimeZones does only return time zone names but not the offset?

Am I missing a EM (or possibly TM) setting?

  • SAPK-92003INSCEMSRV
  • SAPK-74012INSAPGWFND

Regards,

Jan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 30, 2015 at 07:13 AM

    Hi Jan,

    if you look in the customizing /SAPTRX/UCCF:

    You can add a configured field for the timezone in that the timestamp should be filled:

    The timezone from this field is provided in the Odata Service if you check the metadata and used in the app.

    I will discuss if we can change something on the misleading Z that indicates UTC.

    Best regards,

    Steffen


    Add comment
    10|10000 characters needed characters exceeded

    • Hi Jan,

      Steffen is right. The misleading Z is automatically added by Gateway and can unfortunately not be avoided. You have to ignore it - the timestamp refers always to the time zone that comes with it.

      In the EM backend customizing you have to ensure that the configured fields that represent a timestamp have the semantics 'Timestamp' and that a second configured field is assigned as 'Configured Field for Timezone'. This field has to have the semantics 'Timezone'.

      For the most important timestamps used in EM there are already standard configured fields available:

      • Expected Date/Time: EXP_DATE_TS and EXP_TIMEZONE
      • Actual Date/Time: REP_DATE_TS and REP_TIMEZONE
      • Reporting Date/Time: MSG_DATE_TS and MSG_DATE_TZ

      You only have to add the configured that refers to the (local) timestamp into your display profile. A property for the time zone will be generated automatically in the related entity of the EM OData service.

      Of course, the timestamp provided by the OData service reflects only correct date/time/timezone if the configured field with semantics 'Timestamp' refers to a local timestamp field and the configured field with semantics 'Timezone' to the corresponding time zone field.

      Best regards, Daniel

  • avatar image
    Former Member
    Oct 30, 2015 at 05:08 AM

    Hi Jan,

    SAP EM customizing allow you to display according to user choice.  The custom table has to be called to retrieve the correct timezone to convert data and time.

    Please check below discussion that help you to resolve.

    Display planned/actual events in local (user) t... | SCN

    time zone | SCN

    Regards


    GGOPII

    P.S:

    Go to below link on page 32 to check "Logic to sync two Timezone Comboboxes"

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40eb1a27-c20b-3310-2a95-fd527941c92b?QuickLink=index&…

    Add comment
    10|10000 characters needed characters exceeded