AFAIK there is no ABAP Open SQL function to get the current date or time on the database server. But you can pass the date and time from the application server using the global variables sy-datum
and sy-uzeit
. Example:
SELECT *
FROM some_table
WHERE due_date = @sy-datum
AND due_time > @sy-uzeit
INTO TABLE @DATA(gt_upcomming_today).
Note that sy-datum
and sy-uzeit
give you the date and time according to the timezone of the application server. If you want to convert those to the timezone of the user (according to the preferences of their user account), then there are and sy-datlo
and sy-timlo
. More information on the time-related fields of structure sy
in the documentation.