Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How using select with TIMESTMP and sy-datum and sy-uzeit ?

Former Member
0 Kudos
499

Hello,

on table ADR6, there's fields VALID_FROM and VALID_TO type TIMESTMP.

How we have to use instead sy-datum ???

select SINGLE smtp_addr into wa_zfink_address_new-email

from adr6

where addrnumber = wa_but021_fs-addrnumber

and PERSNUMBER = w_persnumber

and validfrom < sy-datum

and validto > sy-datum .

Tks.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
208

Convert SY-DATUM/UZEIT to timestamp ([CONVERT DATE|http://help.sap.com/abapdocu_70/en/ABAPCONVERT_DATE_TIME-STAMP.htm]) or use directly use a [GET TIME STAMP FIELD time_stamp. |http://help.sap.com/abapdocu_70/en/ABAPGET_TIME-STAMP.htm]

Regards,

Raymond

2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos
209

Convert SY-DATUM/UZEIT to timestamp ([CONVERT DATE|http://help.sap.com/abapdocu_70/en/ABAPCONVERT_DATE_TIME-STAMP.htm]) or use directly use a [GET TIME STAMP FIELD time_stamp. |http://help.sap.com/abapdocu_70/en/ABAPGET_TIME-STAMP.htm]

Regards,

Raymond

Former Member
0 Kudos
208

You can also use a select option.

SELECT-OPTIONS  so_date FOR wa_date.

SELECT * FROM dbname INTO itab
WHERE dbdate in so_date. "dbdate is the date field in your database

With the select option you have automatically an option for intervals etc. so you dont have to program it by yourself.

Greetings