Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with CONVERT DATE.

former_member183909
Active Participant
0 Likes
1,292

Hi

I have a problem with a SAP Standard bit of code that is calculating the date and time. This SAP standard program is used to determine if Jobs are to be scheduled.

What happens is that instead of my jobs being run at 22:30 they are being run at 13:30. I have figured out it is due to the SAP standard code calculating a CET timezone.

My TimeZone config appears to be correct in the IMG. With the System and Default timezone to be AUNSW.

Here is the snippet of code that I have ripped from a SAP standard program that is causing the problem

REPORT  ZZZTEST.
 DATA: job_wa TYPE sxmsjobs,
        text TYPE string,
        error TYPE REF TO cx_xms_system_error,
        jobs_tab TYPE sxmsjobs_ttyp,
        job TYPE REF TO cl_xms_job,
        now TYPE tzntstmpl.

CONVERT DATE sy-datum  TIME sy-uzeit INTO
  TIME STAMP now TIME ZONE sy-zonlo.


  write /: sy-datum.
  write / sy-uzeit.
  write / sy-zonlo.
  write / now.

Here are the results

Note that

My SU01 Profile shows Personal Time Zone

of the User AUSNSW

Sys. Time Zone AUSNSW

Run in R/3 at 10:42:38 on 27th November

27.11.2008

10:42:38

AUSNSW

20,081,126,234,238.0000000 <<<<<<<THIS IS WRONG. SHOULD BE 27TH !.

3 REPLIES 3
Read only

Former Member
0 Likes
995

Hi ,

CONVERT DATE sy-datum TIME sy-uzeit INTO

TIME STAMP now TIME ZONE sy-zonlo.

 
CONVERT DATE sy-datum  TIME sy-uzeit INTO
  TIME STAMP now TIME ZONE sy-zonlo.

instead of sy-datum and sy-uzeit can u modify this based on sy-datlo and sy-timlo ..."<--

CONVERT DATE sy-datlo  TIME sy-timlo INTO
  TIME STAMP now TIME ZONE sy-zonlo.


Vijay.

Read only

0 Likes
995

Same result anyway.

But my problem is that the code is from a SAP standard program. It is actually in SAP XI SXMS_START_JOBS and this calls a method that has that statement.

So this is SAP standard code. I do not want to repair it just yet.

I want to understand why it does not calculate the value as expected. So if anyone can confirm my suspicions that would be appreciated.

Read only

former_member334189
Active Participant
0 Likes
995

Dear Jonny,

I see the point, but I do not agree.

I just checked this out in one of our internal systems. In the configuration timezone AUSNSW is defined UTC+10. Assigned to this timezone you can find daylight saving rule AUS. According to this rule DST becomes active as +1 hour on last Sunday of October at 2 o'clock. I.e. the system determines your local time to be 11 hours ahead of UTC. Consequently 20,081,126,234,238.0000000 is perfectly correct according to the configurational settings of the system.

Best Regards,

Harald Keimer

XI Development Support

SAP AG, Walldorf