2008 Feb 26 6:39 AM
Hi,
I need a time stamp in my alv report. From where should i get.
How to do it.
Regards,
Adi.
2008 Feb 26 6:53 AM
Hi Adithya,
You can build a timestamp in your program yourself, by concatenating the system date (sy-datum) and system time (sy-uzeit).
Hence do generate a timestamp you code as below:
data: v_timestamp(14) type c.
concatenate sy-datum sy-uzeit into v_timestamp.
Timestamps have format YYYYMMDDHHMMSS.
Cheers.
2008 Feb 26 6:53 AM
Hi Adithya,
You can build a timestamp in your program yourself, by concatenating the system date (sy-datum) and system time (sy-uzeit).
Hence do generate a timestamp you code as below:
data: v_timestamp(14) type c.
concatenate sy-datum sy-uzeit into v_timestamp.
Timestamps have format YYYYMMDDHHMMSS.
Cheers.
2008 Feb 26 6:55 AM
Hi
I think you can use sy-datum and sy-uzeit , System variable to create a time stamp. Put them in a variable and use the variable in your ALV report.
Thanks
Swarna
2008 Feb 26 6:57 AM
Hi swarna but i need this time stamp for very field execution.
2008 Feb 26 7:54 AM
Hi,
it may help u.
ABAP does not contain a special data type for timestamps. Instead, they are stored in fields with data type P.
There is a short and a long form of the timestamp:
Short form: Type P, length 8 Bytes (for example: 19981224235959)
Long form: Type P, length 11 Bytes (for example: 19981224235959,1234567)
The long form of the ABAP timestamp is accurate to 7 decimal places more than the short form.
Comparison and arithmetic
ABAP type P allows simple comparison and assignment of time stamps (even of varying accuracies).
However, general arithmetic with time stamps is not possible. The ABAP processor would interpret the time stamp as a TYPE P number. Therefore, you can use the class CL_ABAP_TSTMP for arithmetical operations with time stamps.
Generating a timestamp
Use the GET TIME STAMP FIELD f statement to place a current timestamp in field f.The time in the timestamp is always given in Universal Time Coordination (UTC) time, formerly known as Greenwich Mean Time. This ensures that the timestamp is always uniquely and globally valid.
Converting timestamps to the local time zone
While the ABAP timestamp is stored internally in UTC time, the external view is that of the local time zone. The aim is to allow the user to work with time data in his or her local time.
To convert between internal (UTC) time and local time, use the following ABAP statements:
UTC to local time:
,,CONVERT TIME STAMP ... TIME ZONE ... INTO DATE ... TIME ...
,,WRITE ... TIME ZONE ....
Local time to UTC:
,,CONVERT DATE ... TIME ... INTO TIME STAMP ... TIME ZONE ...
After TIME ZONE comes the user's local time zone. This is available to the ABAP processor in the system field SY-ZONLO.
The details of the difference between the local time zone, all other time zones in the system, and UTC time is stored in the tables TTZZ, TTZR, TTZD, TTZDF, and TTZDV. You can maintain the tables using Transaction STZBD.
http://www.google.co.in/search?hl=en&q=timestampinabap&btnG=Search&meta
Cheers,
vasavi.
kindly reward if helpful.