SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
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 →Accessing Character-Like Date Fields and Time Fields Numerically
Numeric access to character-like date fields and time fields exploits the fact that the conversion of the types d and t to numeric values produces an integer number of days or seconds. This applies particularly when using character-like date fields and time fields in numeric calculations, where these fields are converted to the corresponding calculation type. This enables differences to be calculated or values to be added or subtracted from character-like date fields or time fields. None of the other arithmetic operations are generally advisable here. To avoid unexpected results from these calculations, you must verify that the content of the date or time fields is valid.
Example
The following calculations provide the current day of the year, plus the hour, minutes, and seconds of the current time. The date and time are provided by a time stamp.
Example
The following calculation produces the day of the week for a date field date containing any valid date. 1 means Monday, 2 means Tuesday, and so on.
Example
The following calculations provides the last day of the previous month.