Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

FIND ALL OCCURRENCES OF REGEX in internal table

$
0
0

Hello,

 

I have an internal table with 2Mio. entries. The table has two character fields. Field 1 is key field and field 2 is my search field.

 

I have to search for a specific  pattern in the second field e.g. find all entries in IT_TABLE where search field contains *XYZ*

 

So I  use FIND ALL OCCURRENCES OF regex WA_VB1 IN TABLE IT_TABLE RESULTS result_tab

 

The result_tab contains now all lines which corresponds to the search pattern.

 

e.g. the result_tab contains now 50.000 entries -> line numers

 

For each line in the result_tab I need now  the value of the first field from  IT_TABLE -> the key field.

 

I am seraching for a fast way to get this values.

 

One possibility is:

 

Loop at reslult_tab....

  read IT_TABLE.... index result_tab-line.

endloop

 

But this is very slow.

 

I am looking for something like:  get all records of IT_TABLE where index is in result_tab-line

 

Any ideas ?

 

Please let me also know if you have another idea to find a specifc search pattern in a big table. E.g. find all entries which contain *XYZ*

 

Thanks


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>