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

Problem at validation

Former Member
0 Likes
647

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.

4 REPLIES 4
Read only

Former Member
0 Likes
606

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

Read only

Former Member
0 Likes
606

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

Read only

Former Member
0 Likes
606

you need to put validation explicitly in your code.

whatever code you have written there is no any validation included.

Read only

0 Likes
606

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