‎2010 Oct 02 7:42 PM
when i am working with validation in select-options i have given 105 to 120 .At this situation the value 105 is in the database its valid but 120 is not in the database eventhough it does not show any error. why?
data :begin of wa_adrc,
addrnumber like adrc-addrnumber,
end of wa_adrc.
data v1 like adrc-addrnumber.
select-options s_addrn for v1.
select addrnumber from adrc into v1 up to 1 rows where addrnumber in s_addrn.
‎2010 Oct 03 12:33 PM
Hi anu,
You might have put validation on the low value of select option. Any ways you don't need to validate all the values falling in the range. Better you use parameter instead of select option.
Thanks
Nitesh
‎2010 Oct 04 10:36 AM
The reason why you are not getting an error is because the field ADDRNUMBER in table ADRC does not have a check table/foreign key attached to it. Hence there is no check and you wont get any error.
So when you input 105 to 120, all existing values in the database in this range will be taken for output/calculation in your program.
Hope this info is useful and solves your problem.
Regards,
Ancy
‎2010 Oct 04 11:25 AM
you need to put validation explicitly in your code.
whatever code you have written there is no any validation included.
‎2010 Oct 05 11:46 PM
Hi Anudeep,
It is standard SAP behaviour for Select-Options.
It will not give any error, if there is any single valid value in the table within the given range. In your case LOW value is valid, so it will select only that record from the table.
Even if you enter both LOW and HIGH values with Invalid and if any one valid value exist in the table in that range, still you will get SUBRC =0.
If you want to validate LOW and HIGH values specifically, you will have to do write select statements with FIELD = SO-LOW /HIGH (Which Highly Not Recommended, not with SAP standards).
Check condition before you write this not recommended statement If SO-LOW is not Initial & if SO-HIGH is not initial for individual validations.
Hope this clarifies you.
Thanks
Lakshmi
Edited by: Lakshmi Narayana L on Oct 6, 2010 12:47 AM