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: 

Enquiry in query

Former Member
0 Kudos

Hi,

I want to give in select query

matnr not starting with the pattern b*.

How will I do??

Pooja

7 REPLIES 7

Former Member
0 Kudos

hello,

I think u can use string operation such as NP(not contain pattern).

regards,

rambabu.

prabhu_s2
Active Contributor
0 Kudos

using pattern search..

prabhu_s2
Active Contributor
0 Kudos

simple and more effiecint is use a range and there u can set the patterns like in select option. this shud also help

Former Member
0 Kudos

Hi

pls see this code..


select * from mara into table it_mara where NOT matnr LIKE 'B%'.

thx

pavan

Former Member
0 Kudos

HI ,

You can do like this.

after getting all entries in itab.

loop at itab into wa_itab where matnr(1) eq 'b'.

delete itab.

endloop.

(wa_itab is work area)

Hope it works.

Reward helpful queries.

Regards,

Siddhesh Sanghvi.

Former Member
0 Kudos

hi

you can even use this code..


TABLES mara.

RANGES: r_matnr FOR mara-matnr.

DATA: it_mara LIKE mara OCCURS 0 WITH HEADER LINE.

REFRESH r_matnr.
r_matnr-sign = 'I'.
r_matnr-option = 'NP'.
r_matnr-low = 'B*'.
APPEND r_matnr.
CLEAR r_matnr.

SELECT * FROM mara INTO TABLE it_mara WHERE matnr IN r_matnr.

hope this helps.

*pls mark for helpful answers

Former Member
0 Kudos

Hi Pooja,

REPORT ZPEX4.

tables mara.

data mat like mara-matnr.

select matnr into mat from mara where NOT matnr like 'B%'.

write : / mat.

endselect.

Rgds,

Prajith