‎2009 Apr 15 2:21 PM
Hi,
I have a requirement like this.
Select-Options will have a field which takes date as input(Say the field name sel_date).
But, this field should be validated somewhere in the middle of the program based on some other date (say the program field name prog_date).
Now, if the prog_date has the range 01.12.2001 to 01.12.2005,
then I should delete the values less than 01.12.2001 and greater than 01.12.2005 in the selection screen field sel_date.
But, the problem is What if the user has entered values using EXTENSION button in the Selection Screen
i.e.,
Including:
1.The values can be set of single entries
2.A range
Excluding:
1.The values can be set of single entries
2.A range
How do we validate all this ???
It is going to be a Loop within a Loop. I want to avoid that.
Is there any other simple solution to achieve this?
Plz let me know
‎2009 Apr 15 2:24 PM
If the EXTENSION button is not of that importance you can remove that.
‎2009 Apr 15 2:26 PM
Sruthi,
How can I remove that? What if the user wanted to enter the date range excluding a time period.
That will be a problem??
‎2009 Apr 15 2:32 PM
Do you need your select-options field to be used in any condition?
‎2009 Apr 15 2:35 PM
Use like this.
date IN (select-options varible) AND date IN prog_date.
‎2009 Apr 15 2:30 PM
Hi,
You can use select option in where condition of loop.
example : loop at itab where matnr in so_matnr.
Thanks,
hari
‎2009 Apr 15 2:30 PM
Combine both the ranges(prog_date and sel_date into a single range or select-option based on your requirement and use the new range for processing the records.
Regards,
Ravi Kanth Talagana
‎2009 Apr 15 2:38 PM
Hi, Why is it going to be in two loops? you keep the date you want to check in two variables, like date_low = 01.01.2009 and date_high - 01.03.2009. The select options will be in a single internal table(both single entries, including date ranges, excluding date ranges). Just loop through this internal table, read the date and compare it with you r date variables.
loop at sel_datetab.
if sel_datetab-low<date_low and sel_datetab-high>date_high.
error.
else.
do your processing.
endif.
endloop.
In the above loop, you can have additional if conditions to check for single entries, excluding date ranges using sel_datetab-sign, sel_datetab-options. Hope this solves.