05-09-2006 12:19 PM
hi
I have little bit doubt about validations.how to validate selection-screen variables .
means shall we prefer select up to 1 row statement or any other method
thanks & Regrds
sandhya
05-09-2006 1:12 PM
Hi,
If you look at any SAP transaction having select-options, it will further proceed with execution even if one value within the range of select option is valid. So the error message not being thrown is right way to go.
05-09-2006 12:22 PM
select single is preferred over select upto 1 rows due to performance improvement of former over the latter.
05-09-2006 12:22 PM
hi
u can also use
select single matnr from mara into v_matnr
where matnr in s_matnr.
s_matnr: select options for matnr.
thanks,
priya.
05-09-2006 12:22 PM
u can validate them on check tables
for that u can use select single or select up to 1 rows
05-09-2006 12:23 PM
05-09-2006 12:40 PM
hi
it all depends on your requirement.say if you need more than one record then you can use SELECT field1 fiel2 INTO TABLE itab WHERE field3 = p_field3.
if you need single record then you can use either SELECT UP TO 1 ROWS etc..
Cheers,
Abdul
Close the thread if ur question has been answered...
05-09-2006 12:49 PM
Hai Sandhya
Check the following Document
use instead of select up to 1 row Select Single Statement
That will increase your Performence also
Thanks & regards
Sreenivasulu P
05-09-2006 1:08 PM
hi again
thanks for ur suggestions
I wrote
select single matnr from mara into v_matnr where matnr in s_matnr.
if sy-subrc ne 0.
message w000(zmsg1) with v_matnr.
endif.
when i entered wrong data in selection variable-low and correct data in selection variable-high it is not throwing warning message I used statement to throw message when wrong data entered.
correct me if any thing wrong.
thanks
sandhya
05-09-2006 1:13 PM
you need to validate your selection screen field in
AT SELECTION-SCREEN event not in your select statement.
for eg.
parameters p1 type i.
AT SELECTION-SCREEN.
IF p1 NE 100.
MESSAGE E001(ZMSG1) WITH p1.
ENDIF.
Cheers,
Abdul
Reward for all useful answers..
05-09-2006 1:12 PM
Hi,
If you look at any SAP transaction having select-options, it will further proceed with execution even if one value within the range of select option is valid. So the error message not being thrown is right way to go.