Wrong Time in Change Documents (Data Element)

1.4k views Asked by At

I created Data element ZDT_NKS_DESCR and flagged Change Document when creating for logging the changes on WebUI table. Everything is good, but the time of changing logging wrong. It adds +3 hours to current time.

For example: if the current time is 10:00 it's logging 13:00 on Web UI.

How can I fix it? Can anybody explain what happens?

Here is my data element (NB: in fact I ticked the "Change Document" checkbox later on):

Flagged the red zone in Data Element Setting

Here is the change logging on Web UI table, the time should be 9:48, 9:48, 9:45 :

Change logging on Web UI table. The time should be 9:48, 9:48, 9:45

P.S: On Web UI timezone is correct.

2

There are 2 answers

4
Sandra Rossi On BEST ANSWER

In ABAP-based softwares, many screens display the dates using the SAP system time unfortunately (that's been always a big problem). Some modules sometimes display the local time (according to user's time) or according to the local time of the partner (transportation modules for instance). So users have to learn for every module or every screen what kind of date/time it is.

Even in database tables, it's impossible to be sure what kind of date/time it is. Usually it's the system time. But some modules may store the date/time according to UTC.

I guess that the times of the change documents are displayed in the system time.

The system time can be seen via the classic SAP GUI, in the menu System > Status > System time.

0
user11823122 On

Here's my final solution based on Sandra answer:

  1. In xxxxx_WRITE_DOCUMENT FM we should change time_of_change value from utime to sy-uzeit. Your CHANGEDOCUMENT_CLOSE function should look like this:
CALL FUNCTION 'CHANGEDOCUMENT_CLOSE'
    EXPORTING
      objectclass             = 'ZCHD00005'
      objectid                = objectid
      date_of_change          = udate
      time_of_change          = sy-uzeit (it's current system time)
      tcode                   = tcode
      username                = username
      object_change_indicator = object_change_indicator
      no_change_pointers      = no_change_pointers
    EXCEPTIONS
      header_insert_failed    = 1
      object_invalid          = 2
      open_missing            = 3
      no_position_inserted    = 4
      OTHERS                  = 5.
  1. If it's necessary, you should change the timezone on WebUI. I'm using system timezone, because of this on WebUI->Personalization->Timezone I choose UTC from F4.

  2. Save and activate your solution!