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 to check if the sy-date is between two dates?

Former Member
0 Kudos

Hi experts,

Can u tell me how to check if the sy-datum is between two dates in a where clause?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use BETWEEN statement.

WHERE sy-datum BETWEEN <dtart_date_date

Thanks

Nitesh

5 REPLIES 5

Former Member
0 Kudos

Hi,

Use BETWEEN statement.

WHERE sy-datum BETWEEN <dtart_date_date

Thanks

Nitesh

Former Member
0 Kudos

Hi,

please explain exactly what u want...

Regards,

neha

Former Member
0 Kudos

Hi,

USE BETWEEN statement.please see the link below for details:

http://books.google.com/books?id=6YU5-HqV5vIC&pg=PA131&lpg=PA131&dq=checkingifthesy-datumisbetweentwo+dates%2Bsap&source=bl&ots=8OksihNn3D&sig=B5KOkGeDQXyM-KTfx4E4Laadeag&hl=en&sa=X&oi=book_result&resnum=1&ct=result.

bpawanchand
Active Contributor
0 Kudos
DATA :
   t_vbak TYPE TABLE OF vbak.
DATA :
   w_d1 TYPE d,
   w_d2 TYPE d.

SELECT *
   FROM vbak
   INTO TABLE t_vbak
   WHERE erdat BETWEEN w_d1 AND w_d2.

Former Member
0 Kudos

hi

in where condition you can do in two types:

p_date1 = lower date

p_date2 = higher date

1)

where sy-datum between p_date1 and p_date2.

2)menthod is

where sy-datum ge p_date1

and sy-datum le p_date2.

Both will work.. try once..

UR's

GSANA