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

how to use like operator in loop

Former Member
0 Likes
3,966

Hi I am trying to use like operation in loop condition. the code is as follows:

loop at lt_mara into l_mara where l_mara like '%XXX'.

-


endloop

when i have the like operator like above its giving me an error that i cannot use like operator. Is there anyway that i can use like operation in loop at condition,

Thanks in advance

Hi I am trying to use like operation in loop condition. the code is as follows:

loop at lt_mara into l_mara where l_mara like '%XXX'.

-


endloop

when i have the like operator like above its giving me an error that i cannot use like operator. Is there anyway that i can use like operation in loop at condition,

Thanks in advance

2 REPLIES 2
Read only

Former Member
0 Likes
1,194

you can try ranges with "CP", this should work for you.

removed by moderator

Regards,

Prabhu Rajesh

Edited by: Durairaj Athavan Raja on Aug 3, 2008 8:47 AM

Read only

Former Member
0 Likes
1,194

using the ranges with CP option we can do that..

Populate the ranges mentioned below..

data: r_matnr type range of matnr,
        w_matnr like line of r_matnr.
w_matnr-low = '%XXX'.
w_matnr-sign = 'I'.
w_matnr-option = 'CP'.
append w_matnr to r_matnr.
loop at lt_mara into l_mara where matnr in r_matnr.

--------------------------------------------------------------------------------
endloop

Regards

Vijay Babu Dudla