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 Statment

Former Member
0 Likes
905

Dear All

I want to use select statement like follows

In the Select statement I want to find field values like not Begin with 'A'

i can use Where <field name> Like 'A%'

in this case all Begin with 'A' values came

but i want not begin with 'A' please help to sole this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
885

use where fieldname <b>not like</b> 'A%'.

regards

shiba dutta

9 REPLIES 9
Read only

Former Member
0 Likes
886

use where fieldname <b>not like</b> 'A%'.

regards

shiba dutta

Read only

Former Member
0 Likes
885

Then use NOT lIKE

this will do it..

Thanks and reward if helpful

Read only

Former Member
0 Likes
885

Hi,

Use <fieldname> NP A*.

NP = Not like.

Thanks!

Brunda

'Reward if useful'.

Read only

varma_narayana
Active Contributor
0 Likes
885

Hi..

Try this way..

SELECT * FROM LFA1 WHERE NAME1 <b>NOT LIKE 'A%'.</b>

Reward if Helpful.

Read only

Former Member
0 Likes
885

Hi

use NOT LIKE at that condition

but allways sap advises don't use negative operation on SELECT statment

because it will result in bad performance

reward if usefull

Read only

Former Member
0 Likes
885

Hi Nelson,

First select the names with the required key fields without giving any comparison for the name.Later delete the records which starts with "a" from it.

Select filedname from tablename into itab where key1.

if sy-subrc eq 0.

delete from itab where fieldname(1) <> 'a'.

endif.

otherwise u can:

loop at itab into wa where fieldname(1) = 'a'.

append wa to itab1.

endloop.

Thanks,

Kaveri

Read only

Former Member
0 Likes
885

Use the statement

SELECT * FROM KNA1 WHERE NAME1 <b>NOT LIKE</b> 'A%'.

Read only

Former Member
0 Likes
885

Thanks All

I got the Result

Read only

Former Member
0 Likes
885

Great ... then assign points to helpful answers and pls close the thread.

regards

shiba dutta