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

search particular pattern

Former Member
0 Likes
845

hi all...

in MB51 i want to find all materials whose third letter is 'a'

e.g t0a1,mianl,anart,aaakk,mmatt etc....

Plz help...

8 REPLIES 8
Read only

FredericGirod
Active Contributor
0 Likes
804

hi,

select * from mara where matnr like '??A%'.

rgd

Frédéric

Read only

0 Likes
804

Hi

Just write a simple ABAP program with the following code

data:

begin of t_matnr occurs 0,

matnr type matnr,

end of t_matnr.

select matnr

from mara

into table t_matnr

where matnr like '__A%'.

loop at t_matnr.

write:/ t_matnr-matnr.

endloop.

Read only

0 Likes
804

hi all...i want to that can we search this in MB51 without ABAP coding....

Read only

0 Likes
804

Hi Madan,

It is not possible, through coding you can search, but this is standard program,that is also ruled out ...

what is your requirement..

Regards

vijay

Read only

0 Likes
804

Hi,

If you want that option for F4 help in Material number,you can do so by ??a*.Then press F4.You will get only those values.

Read only

Former Member
0 Likes
804

HI Madan

you can use

CP --> contains pattern

DATA: str1 TYPE string,

str2 TYPE string.

str1 = 'ABCDEFGH'.

str2 = 'CF+H'.

IF str1 CP str2.

...

ENDIF.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
804

Hi,

Try giving ??a*

Kindly reward points by clikcing the star on the left of reply,if it helps.

Read only

Former Member
0 Likes
804

Hi,

To search a character field for a particular pattern, use the SEARCH statement:

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb33cc358411d1829f0000e829fbfe/content.htm

Best Regards,

Anjali