cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic time zone conversion in web dynpro

frank_stdle
Participant
0 Kudos

We have a WDA running on top of a SAP system that is running on US time. The data from the WDA must be stored in SAP using US time. The WDA will however run in England and needs to display English time to the users. Is there any mechanism or concept in web dynpro that provides automatic time conversion when reading from and displaying time and when writing data back to the database? Some kind of screen exit or other?

I am not asking how to convert the value of a single field from one time zone to another, I am hoping for some general solution to the problem of time zones in web dynpro.

Thanks!

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I don't really have anything useful to say, but couldn't help to add my two cents here...

Whenever you work in a system that supports users or other parties spread among different time zones you start wishing for some better time zone support. It's not just the user's time zone that is relevant, just imagine for example a service call to a call center in India, where probably the customer's time zone is even more important than the user time zone.

I know that in principle we have some design issue here, because standalone dates (without any time details) are impossible to convert among different time zones. It would be nice though if the system would provide a framework where any date/time fields can be registered and linked to some time zone field. Changing the time zone field, would automatically update all registered date/time fields.

Ideally the field for choosing time zones would have the ability to show a list of preferred time zones with (changeable) explanations. One could for example imagine that by default it's populated with the two entries for user time zone and system time zone. Each application should be able to register additional time zones, e.g. sold-to time zone for an order, etc.

Another (workaround) option I used in applications (for automatically filled read-only fields, like creation date/time) is to settle on one reasonable default time zone (e.g. user) and then have tool tips showing dates/times in other relevant time zones.

Anyhow, lots of half-baked gibberish, essentially I just wanted to say that it would be nice to have some better time zone support, so I'm voting for that as well (good point Chris). And ideally this would not be limited to web dynpro. I'm sure some smart person should be able to come up with something nice...

Cheers, harald

frank_stdle
Participant
0 Kudos

Thanks to both of you, it was a long shot, but now I know I am not wasting my time doing the conversion manually.

Chris, I agree this would be a nice feature for a future release though.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>- add to the sticky - would be pretty cool - an auto timezone adjusted date time field - you put in system time and it adjusts to user timezone - possibly a flag on the context (like the display with leading zeros flag).

We kind of already have the functionality - although it is in standard ABAP. There are system fields - SY-TIMLO and SY-DATLO that always contain time and date relative to the user timezone settings.

For everything else you should store as/convert to a timestamp field and and then convert to whatever timezone you want to use. SY-ZONLO is the system field that contains the timezone from the user profile.

ChrisPaine
Active Contributor
0 Kudos

Still - it would be pretty cool if the UI element did the conversion - like dates are formatted per the user settings (well, not really like that but a similar sort of idea about user settings altering the layout).

I can imagine an application which allows user to ask for a reminder date/time which could be input - but would need to be input in user timezone...

(actually now I think more about it it - that might be the only use case - and you'd still need to validate that the user's timezone is correct - and then build something to allow them to reset it... Perhaps just doing a few lines of additional code for these rare use cases is more realistic )

frank_stdle
Participant
0 Kudos

Thanks to both of you, it was a long shot, but now I know I am not wasting my time doing the conversion manually.

Chris, I agree this would be a nice feature for a future release though.

frank_stdle
Participant
0 Kudos

Thanks to both of you, it was a long shot, but now I know I am not wasting my time doing the conversion manually.

Chris, I agree this would be a nice feature for a future release though.

frank_stdle
Participant
0 Kudos

Thanks to both of you, it was a long shot, but now I know I am not wasting my time doing the conversion manually.

Chris, I agree this would be a nice feature for a future release though.

ChrisPaine
Active Contributor
0 Kudos

The only way that the Web Dynpro could conceivably alter the time zone would be from the user's timezone settings - as locale as passed from the browser does not include this information.

In SU01 there is an area where the user's timezone can be set.

I'm pretty sure that WDA doesn't automatically apply these changes to any date/time field - as there are many cases where you wouldn't want the actually stored value to be modified by the user's timezone.

However, you could easily within your application code use the timezone to adjust the time/date displayed for certain fields for the user.

Suggest that you request it for a new feature - add to the sticky - would be pretty cool - an auto timezone adjusted date time field - you put in system time and it adjusts to user timezone - possibly a flag on the context (like the display with leading zeros flag).

Sorry that probably doesn't help much!

Cheers,

Chris

Edited by: Chris Paine on Jun 15, 2010 11:11 AM - typo - "does" correct to "doesn't"