ABAP Keyword Documentation → ABAP - Reference → Processing Internal Data → Date and Time Processing → Character-Like Date Fields and Time Fields
Accessing Character-Like Date Fields and Time Fields
Only a few operand positions are affected by the fact that character-like date fields and time fields contain a local date in the format "yyyymmdd" or a local time in the format "hhmmss":
- When using character-like date fields and time fields as source fields or target fields of the statement
MOVE EXACT
.
- When converting a local date and a local time to a
time stamp using
CONVERT INTO TIME STAMP
and back again usingCONVERT TIME STAMP
.
- In output formatting using string templates or the statement
WRITE [TO]
- When mapping to asXML
In all other operand positions, the handling of character-like date fields and time fields is specified in the conversion rules and comparison rules for these data types.
- The conversion rules are designed so that data objects of the types
d
andt
display character-like behavior in character-like operand positions and numeric behavior in numeric operand positions. In the latter case, the content of a character-like date field is converted to the number of days since 01.01.0001 and the content of a character-like time field is converted to the number of seconds since midnight.
- The comparison rules are designed so that a later date or later time is greater than an earlier date or earlier time.
Direct assignments or comparisons between the data types d
and t
are meaningless and therefore forbidden. The following sections show examples of how to access character-like date fields and time fields effectively.
Other versions: 7.31 | 7.40 | 7.54
Note
The function modules of the function group SCAL provide some additional information about character-like dates, for example the day of the week or the calendar week for a given date.
Continue
Character-Like Access to Character-Like Date Fields and Time Fields
Accessing Character-Like Date Fields and Time Fields Numerically