SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Date and Time Processing → Time Stamp →Syntax
GET TIME STAMP FIELD time_stamp.
Effect
This statement creates a POSIX UTC time stamp from the system time and system date in AS ABAP and assigns it to the variable time_stamp.
The following can be specified for time_stamp:
Note
The precision of the decimal places of the long form depends on the hardware (processor) of the
application server.
The maximum resolution of 100 ns is not always reached. On some platforms, only a resolution of milliseconds can be reached.
Example
Creates two time stamps. An existing variable of the type TIMESTAMPL must be used for the long form. An inline declaration can be used for the short form. The time stamps must be given a special format for the output, since otherwise only numbers of type p would be displayed.
DATA tsl TYPE timestampl.
GET TIME STAMP FIELD DATA(ts).
GET TIME STAMP FIELD tsl.
cl_demo_output=>new(
)->write( |{ ts TIMESTAMP = ISO
TIMEZONE = 'UTC' }|
)->write( |{ tsl TIMESTAMP = ISO
TIMEZONE = 'UTC' }|
)->display( ).
Non-Catchable Exceptions