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

Regarding Validations

Former Member
0 Likes
904

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
860

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.

9 REPLIES 9
Read only

Former Member
0 Likes
860

select single is preferred over select upto 1 rows due to performance improvement of former over the latter.

Read only

Former Member
0 Likes
860

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.

Read only

Former Member
0 Likes
860

u can validate them on check tables

for that u can use select single or select up to 1 rows

Read only

0 Likes
860

Read only

abdul_hakim
Active Contributor
0 Likes
860

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

Read only

Former Member
0 Likes
860

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

Read only

0 Likes
860

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

Read only

0 Likes
860

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

Read only

Former Member
0 Likes
861

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.