<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ABAP TIMESTAMP is wrongly formatted in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276298#M1988326</link>
    <description>&lt;P&gt;It looks like there is a &lt;STRONG&gt;&lt;EM&gt;TIMESTAMP&lt;/EM&gt;&lt;/STRONG&gt; domain based on &lt;STRONG&gt;&lt;EM&gt;CHAR14&lt;/EM&gt;&lt;/STRONG&gt; data type, I'll try to apply it.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Sep 2020 14:04:06 GMT</pubDate>
    <dc:creator>MikeB</dc:creator>
    <dc:date>2020-09-01T14:04:06Z</dc:date>
    <item>
      <title>ABAP TIMESTAMP is wrongly formatted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276290#M1988318</link>
      <description>&lt;P&gt;I have a table with a field of the type &lt;STRONG&gt;&lt;EM&gt;TIMESTAMP&lt;/EM&gt;&lt;/STRONG&gt; (&lt;STRONG&gt;&lt;EM&gt;DEC15&lt;/EM&gt;&lt;/STRONG&gt;).&lt;/P&gt;
  &lt;P&gt;The problem is that in the reports and in the &lt;STRONG&gt;&lt;EM&gt;SE16&lt;/EM&gt;&lt;/STRONG&gt; this timestamp is represented in a weird way ("XX.XXX.XXX.XXX.XXX" vs. "YYYY.MM.DD.HH.MM.SS"), e.g. &lt;I&gt;"20.180.805.173.751&lt;/I&gt;&lt;EM&gt;"&lt;/EM&gt; instead of &lt;EM&gt;"&lt;/EM&gt;&lt;EM&gt;2018.08.05.17:37:51"&lt;/EM&gt;.&lt;/P&gt;
  &lt;P&gt;My assumption is that the table date field's format has been changed after a table maintenance screen has been generated.&lt;/P&gt;
  &lt;P&gt;Does anyone know what could be a reason for such mis-formatting in the representation?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 12:11:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276290#M1988318</guid>
      <dc:creator>MikeB</dc:creator>
      <dc:date>2020-09-01T12:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP TIMESTAMP is wrongly formatted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276291#M1988319</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;mikeb.&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;As you mentioned the field is of the DEC15. This means the value contained in it is recognized as a number, not as a date. Hence a separator after every 3 digits.&lt;/P&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Tue, 01 Sep 2020 12:17:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276291#M1988319</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-09-01T12:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP TIMESTAMP is wrongly formatted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276292#M1988320</link>
      <description>&lt;P&gt;Thanks, Mateusz.&lt;/P&gt;&lt;P&gt;Yes it makes sense, but at the same time the data element &lt;STRONG&gt;TIMESTAMP&lt;/STRONG&gt; is the default one provided by SAP for needs of time stamping.&lt;/P&gt;&lt;P&gt;Is there any way to represent it in a more readable way ("YYYY.MM.DD.HH.MM.SS")?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 12:21:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276292#M1988320</guid>
      <dc:creator>MikeB</dc:creator>
      <dc:date>2020-09-01T12:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP TIMESTAMP is wrongly formatted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276293#M1988321</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I don't think it's possible in SE16.&lt;/P&gt;&lt;P&gt;In your own report you can use the CONVERT keyword.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CONVERT TIME STAMP ts TIME ZONE sy-zonlo
  INTO DATE DATA(date) TIME DATA(time)
  DAYLIGHT SAVING TIME DATA(dst).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Tue, 01 Sep 2020 12:29:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276293#M1988321</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-09-01T12:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP TIMESTAMP is wrongly formatted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276294#M1988322</link>
      <description>&lt;P&gt;If you want a 'timestamp' field to be displayed in a human readable and suitable format, look for other domains related to timestamp but with a conversion exit similar to CITST or TSTPS, but not with a DEC (packed) field.  (A must read is blog &lt;A href="https://blogs.sap.com/2016/08/29/about-time-stamps/"&gt;About Timestamps&lt;/A&gt; by  &lt;SPAN class="mention-scrubbed"&gt;horst.keller&lt;/SPAN&gt;.)&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 13:00:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276294#M1988322</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2020-09-01T13:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP TIMESTAMP is wrongly formatted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276295#M1988323</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Is it a SAP standard or a custom table?&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Of course you have the option in your own reporting to convert the value by coding e.g. from the Decimal into a String and then into a readable format and present that string in output values (e.g. ALV) instead of the decimal.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;But in order to always have the Decimal converted into a readable Date/Time value,&lt;/STRONG&gt; no matter where the table attribute is used (e.g. SE16N, Selection Screens, etc.), and not have to always develop that logic each time it is used, &lt;STRONG&gt;you will have to change the Conversion Routine of the domain.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;If it is a SAP standard table, you would have to modify the standard domain, which in most cases will not be an option. But you could also create a view of the standard table and exchange the standard data element of the timestamp attribute with a custom data element that has the 'identical' domain, just with the conversion routine that fullfills your purpose. And instead of using the standard table, you would use your custom view.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;If it is a custom table, you can easily assign the TIMES conversion routine to a custom domain of your timestamp (or use standard data elements and/or domains that utilize conversion routines like TIMES), or implement your own conversion routine if you have different output requirements&lt;/STRONG&gt; (e.g. which timezone other than the time zone of the current user, sy-zonlo, should be used?):&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1838663-custom-timestamp.png" /&gt;&lt;/P&gt;&lt;P&gt;The following screenshot shows on the left when the conversion exit is applied (by default in GUI output), and on the right when it is suppressed by SE16N settings:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1838662-conversionexit-time.png" /&gt;&lt;/P&gt;&lt;P&gt;This is what the Conversion Exit TIMES for Output looks like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION conversion_exit_times_output.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(INPUT)
*"  EXPORTING
*"     VALUE(OUTPUT)
*"----------------------------------------------------------------------
  DATA:   l_timestmp TYPE tzntstmps,
          l_date TYPE d,
          l_time TYPE t,
          l_input TYPE string,
          l_init_timestmp(14) type n.

  output = input.

  l_input = input.
  CONDENSE l_input.
  IF NOT l_input IS INITIAL
  AND l_input CO '0123456789.'.
    l_timestmp = l_input.
    CONVERT TIME STAMP l_timestmp TIME ZONE sy-zonlo
            INTO DATE l_date TIME l_time.

    if sy-subrc = 0 or l_input = l_init_timestmp.
      WRITE l_date TO output.
      WRITE l_time TO output+12.
    ENDIF.

  ENDIF.

ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Of course you should also implement the Conversion Exit for Input, as it comes really handy when setting timestamps for selection or setting in GUI input fields.&lt;/P&gt;&lt;P&gt;The Conversion Exit TIMES for Input looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION conversion_exit_times_input.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(INPUT)
*"  EXPORTING
*"     VALUE(OUTPUT)
*"----------------------------------------------------------------------

statics: s_init_date(10)    type c,
         s_init_time(8)     type c.

* BW12B PATCH20 CHM20000329
  DATA: l_date LIKE sy-datum,
        l_time LIKE sy-uzeit,
        l_date_c(15) TYPE c,
        l_time_c(15) TYPE c,
        l_init_date  type d,
        l_init_time  type t,
        l_tstamp     LIKE tzonref-tstamps.

  IF input IS INITIAL.
    CLEAR output.
    EXIT.
  ENDIF.

  if s_init_date is initial.
    write l_init_date to s_init_date.
    write l_init_time to s_init_time.
  endif.

  SPLIT input AT space INTO l_date_c l_time_c.
  CONDENSE l_date_c.
  CONDENSE l_time_c.
* BW30B PATCH11 CHM20030218
  IF l_date_c = s_init_date.                           "H1373765 time can be 00:00:00
    CLEAR output.
    EXIT.
  ENDIF.
* BW30B PATCH11 CHM20030218
  CALL FUNCTION 'CONVERT_DATE_INPUT'
    EXPORTING
      input                     = l_date_c
    IMPORTING
      output                    = l_date
    EXCEPTIONS
      plausibility_check_failed = 1
      wrong_format_in_input     = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    IF sy-subrc = 1.
      MESSAGE s070(rsdd) DISPLAY LIKE 'E' WITH l_date_c.
    ELSEIF sy-subrc = 2.
      MESSAGE s071(rsdd) DISPLAY LIKE 'E' WITH l_date_c.
    ENDIF.
    l_date = sy-datum.
  ENDIF.
  IF l_time_c IS INITIAL.
    l_time = sy-uzeit.
  ELSE.
    CALL FUNCTION 'CONVERT_TIME_INPUT'
      EXPORTING
        input                     = l_time_c
      IMPORTING
        output                    = l_time
      EXCEPTIONS
        plausibility_check_failed = 1
        wrong_format_in_input     = 2.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      IF sy-subrc = 1.
        MESSAGE s072(rsdd) DISPLAY LIKE 'E' WITH l_time_c.
      ELSEIF sy-subrc = 2.
        MESSAGE s073(rsdd) DISPLAY LIKE 'E' WITH l_time_c.
      ENDIF.
      CLEAR l_time.
    ENDIF.
  ENDIF.
  CONVERT DATE l_date TIME l_time INTO
     TIME STAMP l_tstamp TIME ZONE sy-zonlo.

  output = l_tstamp.

* BW12B PATCH20 CHM20000329

ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Sep 2020 13:00:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276295#M1988323</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-09-01T13:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP TIMESTAMP is wrongly formatted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276296#M1988324</link>
      <description>&lt;P&gt;Thanks for the detailed expalanation.&lt;/P&gt;&lt;P&gt;It's a custom table.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 13:02:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276296#M1988324</guid>
      <dc:creator>MikeB</dc:creator>
      <dc:date>2020-09-01T13:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP TIMESTAMP is wrongly formatted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276297#M1988325</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;mikeb.&lt;/SPAN&gt;, so you should be able to easily set the TIMES conversion routine for your custom domain, or use any other of the above mentioned solutions. Let me know if there are any further issues with solving your requirement.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 13:12:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276297#M1988325</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-09-01T13:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP TIMESTAMP is wrongly formatted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276298#M1988326</link>
      <description>&lt;P&gt;It looks like there is a &lt;STRONG&gt;&lt;EM&gt;TIMESTAMP&lt;/EM&gt;&lt;/STRONG&gt; domain based on &lt;STRONG&gt;&lt;EM&gt;CHAR14&lt;/EM&gt;&lt;/STRONG&gt; data type, I'll try to apply it.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 14:04:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-timestamp-is-wrongly-formatted/m-p/12276298#M1988326</guid>
      <dc:creator>MikeB</dc:creator>
      <dc:date>2020-09-01T14:04:06Z</dc:date>
    </item>
  </channel>
</rss>

