Application Development 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: 

Regarding Validations

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

u can validate them on check tables

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

0 Kudos

abdul_hakim
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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.