ABAPGET_TIME-STAMP - GET TIME-STAMP

Fill RESBD Structure from EBP Component Structure   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

GET TIME STAMP

Short Reference



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:

  • An existing variable of the data type TIMESTAMP or TIMESTAMPL from ABAP Dictionary, in accordance with ABAP type p with length 8 or p with length 11, with seven decimal places. Depending on the data type, the time stamp is created either in the short form or in the long form.
  • An inline declaration DATA(var), where a variable of type TIMESTAMP is declared.

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( ).

Exceptions

Non-Catchable Exceptions

  • Cause: The target field differs from TIMESTAMP or TIMESTAMPL with respect to type, length, and decimal places.
    Runtime Error: GET_TIMESTAMP_FORMAT







Addresses (Business Address Services)   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.


Length: 3829 Date: 20160526 Time: 023223     sap01-206 ( 49 ms )

Intercompany Suite

Optimized Intercompany processes simplify the consolidation!

 Intercompany Processes