Application Development and Automation 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: 
Read only

Peculiar problem with Select-Options Validation

Former Member
0 Likes
803

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

7 REPLIES 7
Read only

Former Member
0 Likes
764

If the EXTENSION button is not of that importance you can remove that.

Read only

0 Likes
764

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??

Read only

0 Likes
764

Do you need your select-options field to be used in any condition?

Read only

0 Likes
764

Use like this.

date IN (select-options varible) AND date IN prog_date.

Read only

Former Member
0 Likes
764

Hi,

You can use select option in where condition of loop.

example : loop at itab where matnr in so_matnr.

Thanks,

hari

Read only

Former Member
0 Likes
764

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

Read only

Former Member
0 Likes
764

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.