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

select - option

Former Member
0 Likes
557

Hi Friends..

If i will give 5* in select statement i want to display all the records start from 5

if i will give 50* in select statement i want to display all the records start from 50

for that scenario what can i do..

can any one explain..

Thanks

Gowrishankar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
537

Hi

Use % symbol in where condition of the select statement

SELECT MATNR FROM MARA WHERE MATNR = '5%'.

IT WILL PICKUP ALL MATERIALS STARTING WITH 5..

Reward points for useful Answers

Regards

Anji

6 REPLIES 6
Read only

Former Member
0 Likes
537

hi..

better u use <b>' 5%' and %50%</b> instead of 5* and 50*..

if u use 5% and 50% it will work properly..

Thanks

Ashu

Read only

Former Member
0 Likes
537

Hi ,

Get the data in a variable, concatenate it with % and then use like statement in where clause in select statement.

concatenate '5' '%' into var.

Select * from table into itab where field like var.

Regards,

Sumit

Read only

Former Member
0 Likes
537

Hi,

First case

WHERE Field LIKE '5%'.

Second case

WHERE Field LIKE '50%'.

Regards,

Ranjit Thakur.

<b>Please Mark The Helpful Answer.</b>

Read only

Former Member
0 Likes
538

Hi

Use % symbol in where condition of the select statement

SELECT MATNR FROM MARA WHERE MATNR = '5%'.

IT WILL PICKUP ALL MATERIALS STARTING WITH 5..

Reward points for useful Answers

Regards

Anji

Read only

0 Likes
537

ok friends thanks for your reply..

one small correction.

If i will give the input in select-option at that time i want to disp[lay all the value.

if i give 5* or 5% means,i want the output like,,

all the numbers start from 5.

Read only

Former Member
0 Likes
537

HI,

In the select statment you need to use % symbol to get al the records statrts from .....

SELECT * from TABLE INTO ITAB WHERE NAME like '5%'.

Regards

Sudheer