Application Development 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: 

Converting long date format - micro seconds are lost

Former Member
0 Kudos

Hi all,


I am attempting to convert a long date format and the micro seconds are lost.


Sample code:


********************************************************************

   data: l_long  TYPE TIMESTAMPL,
      l_short TYPE tzntstmps.

   DATA:
    l_timestamp TYPE tzntstmps,
    l_datlo     TYPE sy-datum,
    l_timlo     TYPE char20.

   START-OF-SELECTION.

    GET TIME STAMP FIELD l_long.

    GET TIME STAMP FIELD l_short.

   CONVERT TIME STAMP l_long TIME ZONE 'BRAZIL'
       INTO DATE l_datlo TIME l_timlo.

************************************************************************

Results:


   l_long = 20130925200307.6550000


   l_datlo = 20130925


   l_timlo = 170307   NOTE: the .6550000 is missing.


The SAP documentation on CONVERT states:

       If the time stamp in time_stamp is in the long form, the seconds fractions in the decimal places are ignored.


I need the micro seconds.  Other than using string processing (SPLIT and CONCATENATE) Does anyone know a good way to resolve this problem?


Regards,

Steve

1 REPLY 1

Former Member
0 Kudos

Hi Steve,

Maybe this post helps you.

...need Timestamp in Milliseconds since 1970 in ABAP  (link: http://scn.sap.com/thread/1333173)

Regards,

Renzo.