Get Example source ABAP code based on a different SAP table
Time Stamp Fields with Time Stamp Type ABAP contains the built-in ABAP type utclong>> for time stamps with a precision of 100 nanoseconds. A data object of this time stamp type is a time stamp field. Each valid value of a time stamp field is a UTC time stamp> and represents a unique time in UTC> reference time. In accordance with the POSIX standard, leap seconds> are not supported, that is, each day has exactly 86400 seconds. ITOC
Access to Time Stamp Fields Time stamp fields can be used in suitable operand positions and special assignment> and comparison rules> apply. Time stamp fields are only convertible to text fields > of the type c> and text strings> of the type string>. The following functions, statements, and classes are designed specifically for time stamp fields:
Time stamp functions>
Conversion Statements for Time Stamp Fields>
System Class for Time Stamp Fields> A time stamp field must have valid content each time it is used. If a time stamp field is used that contains an invalid time stamp or the initial value, a catchable exception of the class CX_SY_CONVERSION_NO_DATE_TIME> is usually raised. The content remains unchecked only in castings or in assignments between time stamp fields.
Latest notes: For time stamp fields, conversion errors raise an exception of the class CX_SY_CONVERSION_NOT_SUPPORTED> >. NON_V5_HINTS ABAP_HINT_END
Initial Value of a Time Stamp Field The initial value of a time stamp is not a real time stamp value, that is, it represents an empty value, which is handled as follows, and not a time stamp:
In comparisons> and sorts based on comparisons, an initial time stamp field is smaller than every real time stamp.
An initial time stamp field passed as an argument is handled like the smallest real time stamp in the time stamp functions>.
In the conversion statements>, initial time stamp fields produce initial results.
During the conversion> to character-like fields, an initial time stamp field fills a text field with spaces or creates an empty text string.
During formatting as a character string using string templates> or with the statement WRITE TO>>, an initial time stamp field creates a character string consisting of spaces.
Internal Representation of a Time Stamp in a Time Stamp Field The internal representation of the valid values of a time stamp field> with the time stamp type> utclong>> are uninterrupted sequences of integers starting from 0, where 0 represents the initial value and each number greater than 0 is assigned exactly one real time stamp.
The minimum internal value is 1 and corresponds to the time stamp 0001-01-01T00:00:00.0000000>.
The maximum internal value is 3,155,380,704,000,000,000 and corresponds to the time stamp 9999-12-31T23:59:59.9999999>.
The time interval between time stamps, which is represented by two adjacent integers, is 100 ns. Each integer between the minimum and maximum value represents a time stamp of 100 ns multiplied by the value of the number after 0001-01-01T00:00:00.0000000>.
Time stamp fields must meet an alignment requirement >. Their memory address must be divisible by eight.
Latest notes: Due to the switch from the Julian calendar to the Gregorian calendar, the time stamps 1582-10-04 23:59:59.9999999> and 1582-10-15T00:00:00.0000000> are directly adjacent. Internally, they are represented using two consecutive integers. NON_V5_HINTS ABAP_HINT_END