Convert TIMESTAMPL (long timestamp) to TIMESTAMP up to 60

I have an OData service that returns some DateTime values. They are stored in a table in Backend as TIMESTAMPL(with some other data).

Now there is a value of '20160630084459.5000'. From MOVE-CORRESPONDINGto 'et_entityset' where it is 'TIMESTAMP'. Due to rounding, it gets' 20160630084460 ', since the seconds must be between' 00 'and '59', this is not a valid return value.

My main problem is that my table has a lot of records, so I need an efficient way to fix this error.

Invalid timestamp was a typo, thanks

+4
source share
2

, TIMESTAMPL . YYYYMMDD. , 20160630084459.5000 20163006084459.5000 (20160630 vs. 20163006).

-, .

REPORT zzy NO STANDARD PAGE HEADING.

FORM convert_timestamp.
  DATA(l_t1) = CONV timestampl('20160630084459.5000').
  DATA: l_t2 TYPE timestamp.
  l_t2 = l_t1.
  WRITE / : l_t1, l_t2.
  CONVERT TIME STAMP l_t1 TIME ZONE sy-zonlo INTO DATE DATA(l_date) TIME DATA(l_time).
  CONVERT DATE l_date TIME l_time INTO TIME STAMP l_t2 TIME ZONE sy-zonlo.
  WRITE / l_t2.
ENDFORM.

START-OF-SELECTION.
  PERFORM convert_timestamp.

.

20.160.630.084.459,5000000
20.160.630.084.460
20.160.630.084.459

+2

, , . . FLOOR TIMESTAMPL TIMESTAMP, , . MOVE-CORRESPONDING, , .

, 0: 59,9 0:59, 1:00. , FLOOR. , , .

0

All Articles