‎2007 Nov 02 10:01 AM
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
‎2007 Nov 02 10:05 AM
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
‎2007 Nov 02 10:02 AM
HHMMSSZZZ (H=hours, M=minutes, S=seconds, Z=milliseconds).
YOU CAN USE THE FM: CRMBW_GET_TIME
Message was edited by:
Muthurajan Ramkumar
‎2007 Nov 02 10:05 AM
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
‎2007 Nov 02 2:36 PM