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 statement with where condition

Former Member
0 Likes
837

HI all ,

I want to extract data from data base table with where condition with Z*.

How can i do that?

select * from mara into table it_mara where matnr = '12*'.

but iam unable to get materials starts with 12 .

how can i get that one?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
804

WHERE matnr LIKE '12%'.

6 REPLIES 6
Read only

Former Member
0 Likes
805

WHERE matnr LIKE '12%'.

Read only

0 Likes
804

But you should remember that material numbers are stored with leading zeros internally (if your material numbers are all numeric). So this still may not give you what you wanted to achieve.

Read only

0 Likes
804

Thanks guys .

Message was edited by:

priya katragadda

Read only

Former Member
0 Likes
804

select * from mara into table it_mara where matnr like '12%'.

null

Read only

Former Member
0 Likes
804

do this way

select * from mara into table it_mara where matnr like'12%'.

Regards,

Santosh

Read only

ferry_lianto
Active Contributor
0 Likes
804

Hi,

You can also use ranges.


tables: mara.

ranges: r_matnr for mara-matnr.

r_matnr-sign = 'I'.
r_matnr-option = 'CP'.
r_matnr-low = '12*'.
append r_matnr.

select * from mara into table it_mara where matnr in r_matnr.

Regards,

Ferry Lianto