Application Development and Automation 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: 
Read only

time milliseconds

Former Member
0 Likes
8,104

Hi Experts

I'd like to get the current time up to the millisecond, is that possible in ABAP ?

I need this for a timestamp for data records in BW

Thanks

Thibault

1 ACCEPTED SOLUTION
Read only

Former Member
3,825

Hi Thibault Jacobs,

Yes,

You can use <b>GET TIME</b> keyword and there you can specify the format that you want.

<b>OR</b>

GET TIME STAMP FIELD time_stamp.

Effect

This statement assigns a time stamp for the current UTC reference time of the ABAP system> to the variable time_stamp. The data object time_stamp must have either the data type TIMESTAMP or TIMESTAMPL from the ABAP Dictionary corresponding to ABAP type p of length 8 or p of length 11 with seven decimal places. Depending on the data type of time_stamp, the time stamp is created either in short or long form.

Note

The accuracy 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

Determining the current time stamp in the long form and using it to log the point in time, at which a row is inserted into a database table.

DATA: BEGIN OF wa,

...

time_stamp TYPE timestampl,

...

END OF wa.

...

GET TIME STAMP FIELD wa-time_stamp.

INSERT dbtab FROM wa.

Regards,

Rama chary.Pammi

3 REPLIES 3
Read only

Former Member
0 Likes
3,825

HHMMSSZZZ (H=hours, M=minutes, S=seconds, Z=milliseconds).

YOU CAN USE THE FM: CRMBW_GET_TIME

Message was edited by:

Muthurajan Ramkumar

Read only

Former Member
3,826

Hi Thibault Jacobs,

Yes,

You can use <b>GET TIME</b> keyword and there you can specify the format that you want.

<b>OR</b>

GET TIME STAMP FIELD time_stamp.

Effect

This statement assigns a time stamp for the current UTC reference time of the ABAP system> to the variable time_stamp. The data object time_stamp must have either the data type TIMESTAMP or TIMESTAMPL from the ABAP Dictionary corresponding to ABAP type p of length 8 or p of length 11 with seven decimal places. Depending on the data type of time_stamp, the time stamp is created either in short or long form.

Note

The accuracy 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

Determining the current time stamp in the long form and using it to log the point in time, at which a row is inserted into a database table.

DATA: BEGIN OF wa,

...

time_stamp TYPE timestampl,

...

END OF wa.

...

GET TIME STAMP FIELD wa-time_stamp.

INSERT dbtab FROM wa.

Regards,

Rama chary.Pammi

Read only

0 Likes
3,825

Hi Rama

Thanks for the answer

Points awarded

Thibault