<?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: find a specific value in Internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733875#M34680</link>
    <description>&lt;P&gt;If you need only one entry try using 'READ' or if you need multiple entries and you need to loop then you can use 'LOOP AT WHERE'.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;LOOP AT tbl_tab1 INTO wa_tab1 WHERE wa_matnr = '20-30412'.
*  Write the code here
ENDLOOP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 31 Jul 2018 04:17:39 GMT</pubDate>
    <dc:creator>former_member539238</dc:creator>
    <dc:date>2018-07-31T04:17:39Z</dc:date>
    <item>
      <title>find a specific value in Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733873#M34678</link>
      <description>&lt;P&gt;Hallo experts,&lt;BR /&gt;I am trying to find a specific value 'material number' in an internal table , to do this I have wrote the code below , but it still missing me something, as I am receiving no results.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF tab2,
lo_matnr TYPE matnr,
 END OF tab2.
DATA: BEGIN OF wa_tab1,
wa_matnr TYPE matnr,
 END OF wa_tab1,
 tbl_tab1 LIKE TABLE OF wa_tab1
                     WITH KEY wa_column1,
      tbl_tab1_result TYPE match_result_tab,
      wa_tab1_result LIKE LINE OF tbl_tab1_result.

wa_tab1-wa_matnr = wa_mara-matnr.
APPEND wa_tab1 TO tbl_tab1.
FIND ALL OCCURRENCES OF '20-30412' IN TABLE tbl_tab1
              RESULTS tbl_tab1_result IN CHARACTER MODE.
LOOP AT tbl_tab1_result INTO wa_tab1_result.
  READ TABLE tbl_tab1 INTO wa_tab1 INDEX wa_tab1_result-line.
  IF sy-subrc = 0.
    WRITE:/ 'Line:', wa_tab1_result-line, 'Offset:', wa_tab1_result-offset.
    WRITE: 'Value is:',  wa_tab1+wa_tab1_result-offset(3).
  ENDIF.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Many thanks in advance &lt;/P&gt;
  &lt;P&gt;Jenie&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 13:21:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733873#M34678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-30T13:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: find a specific value in Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733874#M34679</link>
      <description>&lt;P&gt;I think this may be the problem:&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;tbl_tab1 LIKE TABLE OF wa_tab1 WITHKEY wa_column1,&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;as the table must be standard table with no secondary table keys, why dont you try: (orelse your table dont have that data pattern)&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;TBL_TAB1 TYPE TABLE OF TAB2 WITH KEY LO_MATNR,&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Jul 2018 00:50:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733874#M34679</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-07-31T00:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: find a specific value in Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733875#M34680</link>
      <description>&lt;P&gt;If you need only one entry try using 'READ' or if you need multiple entries and you need to loop then you can use 'LOOP AT WHERE'.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;LOOP AT tbl_tab1 INTO wa_tab1 WHERE wa_matnr = '20-30412'.
*  Write the code here
ENDLOOP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Jul 2018 04:17:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733875#M34680</guid>
      <dc:creator>former_member539238</dc:creator>
      <dc:date>2018-07-31T04:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: find a specific value in Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733876#M34681</link>
      <description>&lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Hello Jenie,&lt;/P&gt;
  &lt;P&gt;see my attachment, with a little modification your code is working. &lt;/P&gt;
  &lt;P&gt;(do not use "-" in names in Unicode programs (WA_MARA-MATNR) or wa_MARA was an internal table?&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Best regards,&lt;BR /&gt;Hedvig&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 06:35:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733876#M34681</guid>
      <dc:creator>hedvig_rohonyi</dc:creator>
      <dc:date>2018-07-31T06:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: find a specific value in Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733877#M34682</link>
      <description>&lt;P&gt;You should really try debugging before asking these kinds of questions. &lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 07:02:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733877#M34682</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-07-31T07:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: find a specific value in Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733878#M34683</link>
      <description>&lt;P&gt;Hallo&lt;A href="https://answers.sap.com/users/18186/hedvigrohonyi.html"&gt; Hedvig,&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;Thanks for your reply , but where can I find your attachment ?&lt;/P&gt;
  &lt;P&gt;Jenie&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 07:21:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733878#M34683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-31T07:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: find a specific value in Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733879#M34684</link>
      <description>&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/175454-ca-del-pngmatnr.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Hallo Jenie, I uploaded again, I hope you can see it now.&lt;/P&gt;
  &lt;P&gt;Best regards,&lt;/P&gt;
  &lt;P&gt;Hedvig&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 07:26:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733879#M34684</guid>
      <dc:creator>hedvig_rohonyi</dc:creator>
      <dc:date>2018-07-31T07:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: find a specific value in Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733880#M34685</link>
      <description>&lt;P&gt;Thank you very much, really helpful.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I have some questions that i hope you can clarify them to me as I find the results somehow not realistic or maybe I am misunderstanding this opertion. So the result above showes :&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Line of Match = 1&lt;/STRONG&gt; ' this mean for me that once i do to mara i will find the matnr 20-30412 in the first line and this is not case as 20-30412 will be found in the row 50250.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Offset from Beginning of Line = 0&lt;/STRONG&gt; ' here once LINE = 1 so the offset will be accordingly 0.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Value is = -20. &lt;/STRONG&gt;I don't know why here the Value is negative.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Many thanks in advance .&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Jenie&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 08:55:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733880#M34685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-31T08:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: find a specific value in Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733881#M34686</link>
      <description>&lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Hello Jenie,&lt;/P&gt;
  &lt;P&gt;1. counting the position specification for a charater begins with 0.&lt;BR /&gt;You can test this e.g. &lt;/P&gt;
  &lt;P&gt;write: wa_mara-matnr+1. -&amp;gt; 0-30412&lt;BR /&gt;write: wa_mara-matnr+0. -&amp;gt; 20-30412&lt;/P&gt;
  &lt;P&gt;online help&lt;BR /&gt;&lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenoffset_glosry.htm"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenoffset_glosry.htm&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;2. Regarding Line of match: You are right. See please my second attachment.&lt;/P&gt;
  &lt;P&gt;3. Value is = -20. It is not negative, but you use command&lt;/P&gt;
  &lt;P&gt;wa_tab1+wa_tab1_result-offset(3) -&amp;gt; "20-" and the third ch&lt;A href="https://answers.sap.com/storage/attachments/175463-ca-del-pngoffset-0.png"&gt;ca-del-pngoffset-0.png&lt;/A&gt;aracter is -.&lt;/P&gt;
  &lt;P&gt;Best regards,&lt;BR /&gt;Hedvig&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 09:34:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-a-specific-value-in-internal-table/m-p/733881#M34686</guid>
      <dc:creator>hedvig_rohonyi</dc:creator>
      <dc:date>2018-07-31T09:34:34Z</dc:date>
    </item>
  </channel>
</rss>

