‎2007 Aug 03 4:09 AM
I have selection screen with select-options field Validity
If the user enters some date
I have to fetch the data from A017 table depends on Datab Datbi that record should display
How to write select query to check the entered date is in between database fields Datab and Datbi
‎2007 Aug 03 4:32 AM
You can write like
if user enters only low value and high value..
declare two variables
data : v_date1 type sy-datum,
v_date2 type sy-datum.
start-of-selection.
loop at s_date. -> select option
v_date1 = s_date-low.
v_date2 = s_date-high.
endloop.
select * from A017 into table int_a017
where datab ge v_date1
and datbi le v_date2.
Thanks
Seshu
‎2007 Aug 03 4:14 AM
Hi Pradeep,
If the date entered is in the select-option then it is very hard to validate the same.
As it involve lots of things to be checked.
Better define date as parameter and use you can check very easily.
Regards,
Atish
‎2007 Aug 03 4:31 AM
if i declare it as parameter how to use it in select query
How to write select query
Can u please tell me
‎2007 Aug 03 4:32 AM
You can write like
if user enters only low value and high value..
declare two variables
data : v_date1 type sy-datum,
v_date2 type sy-datum.
start-of-selection.
loop at s_date. -> select option
v_date1 = s_date-low.
v_date2 = s_date-high.
endloop.
select * from A017 into table int_a017
where datab ge v_date1
and datbi le v_date2.
Thanks
Seshu
‎2007 Aug 03 4:54 AM
hi
good
with the select query stament add the A017-FIELD NAME EQ that field name where you r going to entered the date,
thanks
mrutyun^
‎2007 Aug 03 5:32 AM
Hi,
why don't you use :
where s_validity is your select option
select * from A017
into table int_a017
where datab in s_validity
and datbi in s_validity.
Regards
‎2007 Aug 03 7:23 AM
select-options: s-date for a017-datab.
SELECT *
FROM a017 into itab
WHERE datab LE s_date
AND datbi GE s-date.
reward if useful
anju
‎2007 Aug 03 8:27 AM
‎2007 Aug 03 8:28 AM