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: 

hi.. How to use pattern in the select statement with for all entries tag

Former Member
0 Kudos

hi

i have one scenario i dont know how to proceed with can anyone help me

select * from zmm_matl_formula.

select Matnr from mara

for all entries in i_matlform

where matnr eq '%i_matlform-base%'

The above is not accepted as SAP does not allow.. patterns along with for all entries tag

i tried even using the ranges.. but ranges has certain restriction.. it does not allow huge records

can anyone tell me how to proceed with..

Thanks & Regards

Guhapriyan

I tried using the Range also..

2 REPLIES 2

Former Member
0 Kudos

Hi guhapriyan,

1. it will work with ranges / select options.

2. just copy paste in new program.

(give any pattern and it will give

names of employees with that pattern)

3.

report abc.

tables : pa0001.

*----


select-options : SNAME for pa0001-sname.

data : begin of itab occurs 0,

sname like pa0001-sname,

end of itab.

*----


select sname from pa0001

into table itab

where sname in sname.

*----


loop at itab.

write:/ itab-sname.

endloop.

regards,

amit m.

former_member181962
Active Contributor
0 Kudos

Try like this:

loop at i_matlform.

concatenate '%' i_matlform-base '%' into i_matlform-basepattern.

modify i_matlform index sy-tabix.

endloop.

select Matnr from mara into it_mara

for all entries in i_matlform

where: matnr like i_matlform-basepattern.

Regards,

Ravi