cancel
Showing results for 
Search instead for 
Did you mean: 

contains pattern in range table

former_member658126
Participant
0 Kudos

Hi Gurus,

Please help me with the below requirement. I have created a range table to hold the values in idoc segment.

While reading the range table i have to read only with patten 'ABC*'. Based on this condtions logic has to work differently

used the below.

If ra-atnam cp 'ABC*' This is fAiled even the ra_atnam has containing the record with ABCGDTJE

IF 'ABC*' CP RA_ATNAM[]. please help me how the condition will be successfull.

Thanks,

Chittu.

Accepted Solutions (1)

Accepted Solutions (1)

vijay_hariharan
Contributor
0 Kudos

You'll probably need to use CS(contains String) i.e. ra-atnam CS 'ABC'..
the only thing to note is if any other record has this string even in between i.e. like DEABCFH --> would also be picked up..

former_member658126
Participant
0 Kudos

it is not working

vijay_hariharan
Contributor

Not sure what you are trying.. If RA_ATNAM is your range table then you'll need to code the below

LOOP AT RA_ATNAM ASSIGNING <WA>
WHERE LOW CS 'ABC'. "hopefully there are only EQ records in your Range table
**** Perform your required actions ****
ENDLOOP.

Answers (2)

Answers (2)

former_member658126
Participant
0 Kudos

Thanks everyone for your response. Identified solution for this.

FredericGirod
Active Contributor
0 Kudos
If ra-atnam cp 'ABC*'  <-- will check also for the * 

If ra-atnam cp 'ABC'  <-- should work
former_member658126
Participant
0 Kudos

Hi Federic,

I tried If ra-atnam cp 'ABC'. no luck. it is not going inside the if

FredericGirod
Active Contributor
0 Kudos

Sorry I have miss read.

But this is strange to compare a RANGE table with a pattern.

For example, if my range table contains E EQ 'CDE', you would like a positive answer ?

former_member658126
Participant
0 Kudos

Hi Fereric,

can you please write how to read the record from range table based on that particular pattern.