<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Search in Internal Table Utility -- Need Pointers in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439237#M1648412</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you wanted to find the value in a specific field of the table (and the calling program knows the field it's looking in) you could do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION y_test_function.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(INPUT_TAB) TYPE  ANY TABLE
*"     REFERENCE(FIELDNAME) TYPE  STRING
*"     REFERENCE(SEARCH_VALUE) TYPE  STRING
*"----------------------------------------------------------------------

  FIELD-SYMBOLS: &amp;lt;line&amp;gt; TYPE ANY,
                 &amp;lt;field&amp;gt; TYPE ANY.

  DATA: results TYPE match_result_tab.

  LOOP AT input_tab ASSIGNING &amp;lt;line&amp;gt;.
    ASSIGN COMPONENT fieldname OF STRUCTURE &amp;lt;line&amp;gt; TO &amp;lt;field&amp;gt;.
    FIND ALL OCCURRENCES OF search_value IN &amp;lt;field&amp;gt; IGNORING CASE RESULTS results.
  ENDLOOP.

ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Dec 2011 18:47:31 GMT</pubDate>
    <dc:creator>bryan_cain</dc:creator>
    <dc:date>2011-12-20T18:47:31Z</dc:date>
    <item>
      <title>Search in Internal Table Utility -- Need Pointers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439234#M1648409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am developing a search utility to arrange a internal table based on ranking ie the internal table should be arranged&lt;/P&gt;&lt;P&gt;based on my search term.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will have 2 input parameters&lt;/P&gt;&lt;P&gt;1st Input parameter (structure) will have 2 fields "FIELDNAME"  "SEARCH STRING" (ITAB1)&lt;/P&gt;&lt;P&gt;2nd Input parameter will be internal table which needs to be searched on.(ITAB2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this search function will be used in many programs i c'nt have defined structure of my internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND ALL OCCURRENCES OF ITAB1-SEARCH STRING&lt;/P&gt;&lt;P&gt;      IN                                       ITAB2-FIELDNAME (Field name should be the one which is in ITAB1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i get the fieldname which is given as input in my find all occurrence statement??&lt;/P&gt;&lt;P&gt;What kind of structure should be my internal table more of generic form ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any pointers will be helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Bhanu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 16:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439234#M1648409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T16:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Search in Internal Table Utility -- Need Pointers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439235#M1648410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
FIND ALL OCCURRENCES OF pattern 
  IN TABLE itab table_range
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The statement FIND doesn't find the string in any particular column, rather it find the text in entire row. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, you can create a temp table with only a column. Populate that with the data from ITAB2 and use above statement to find the text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 18:34:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439235#M1648410</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2011-12-20T18:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Search in Internal Table Utility -- Need Pointers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439236#M1648411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhanu ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understood like this , we don't know the structure of itab2 , so how can we check with respect to ITab2,&lt;/P&gt;&lt;P&gt;for this so like this &lt;/P&gt;&lt;P&gt;create data element with type any then assign itab2-field to that type any data element.&lt;/P&gt;&lt;P&gt;data : l_var type any.&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign itab2-field to &amp;lt;l_val&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chceck with that &amp;lt;lavl&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 18:45:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439236#M1648411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T18:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Search in Internal Table Utility -- Need Pointers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439237#M1648412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you wanted to find the value in a specific field of the table (and the calling program knows the field it's looking in) you could do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION y_test_function.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(INPUT_TAB) TYPE  ANY TABLE
*"     REFERENCE(FIELDNAME) TYPE  STRING
*"     REFERENCE(SEARCH_VALUE) TYPE  STRING
*"----------------------------------------------------------------------

  FIELD-SYMBOLS: &amp;lt;line&amp;gt; TYPE ANY,
                 &amp;lt;field&amp;gt; TYPE ANY.

  DATA: results TYPE match_result_tab.

  LOOP AT input_tab ASSIGNING &amp;lt;line&amp;gt;.
    ASSIGN COMPONENT fieldname OF STRUCTURE &amp;lt;line&amp;gt; TO &amp;lt;field&amp;gt;.
    FIND ALL OCCURRENCES OF search_value IN &amp;lt;field&amp;gt; IGNORING CASE RESULTS results.
  ENDLOOP.

ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 18:47:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439237#M1648412</guid>
      <dc:creator>bryan_cain</dc:creator>
      <dc:date>2011-12-20T18:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Search in Internal Table Utility -- Need Pointers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439238#M1648413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  Bryan,&lt;/P&gt;&lt;P&gt;Thanks for your reply i think your solution is close to what i am looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My only concern is FIELDNAME will be a internal table which will have entries with table field names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How will i use the below logic there?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 20:12:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439238#M1648413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T20:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Search in Internal Table Utility -- Need Pointers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439239#M1648414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same idea I would think - just put the "assign component" line inside a loop on your field name parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 20:18:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439239#M1648414</guid>
      <dc:creator>bryan_cain</dc:creator>
      <dc:date>2011-12-20T20:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Search in Internal Table Utility -- Need Pointers</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439240#M1648415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Super like...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 20:28:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-in-internal-table-utility-need-pointers/m-p/8439240#M1648415</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-20T20:28:55Z</dc:date>
    </item>
  </channel>
</rss>

