<?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: Read Internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555909#M582519</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not possible to use OR command on read but there are different approches to acheive this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sairam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jul 2007 14:06:53 GMT</pubDate>
    <dc:creator>former_member196280</dc:creator>
    <dc:date>2007-07-23T14:06:53Z</dc:date>
    <item>
      <title>Read Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555904#M582514</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;&lt;/P&gt;&lt;P&gt;Is it possible to use an 'OR' condition with read table itab into wa with key addition.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:  read table itab into wa with key field1 = A&lt;/P&gt;&lt;P&gt;                                                         or field1 = B&lt;/P&gt;&lt;P&gt;                                                         or field1 = C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Mungala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 13:59:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555904#M582514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T13:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Read Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555905#M582515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not as I can know... you can but, do a three consecutive READ TABLES, one per each field you want to check &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(check the code by Rich Heilman a bit down... it's pretty better than mine :P)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ TABLE itab INTO wa WITH KEY field1 = X.
IF sy-subrc &amp;lt;&amp;gt; 0.
  READ TABLE itab INTO wa WITH KEY field2 = Y.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    READ TABLE itab INTO wa WITH KEY field3 = Z.
  ENDIF. 
ENDIF.

CHECK sy-subrc = 0. "Or an IF, of course&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vicenç Lozano&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited (again) by: &lt;/P&gt;&lt;P&gt;        Vicenç Lozano&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:01:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555905#M582515</guid>
      <dc:creator>VXLozano</dc:creator>
      <dc:date>2007-07-23T14:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Read Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555906#M582516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no you cant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Azad,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:01:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555906#M582516</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T14:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555907#M582517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We can not use the OR condition in the Read table, but you can use the Comparing option to compare the fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:01:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555907#M582517</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T14:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Read Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555908#M582518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No.  You can not do that.  Instead  you can use a Loop with WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab where field1 = 'A'
                       or field1 = 'B'
                       or field1 = 'C'.
* Do what you want here

*Now get out of the loop after first read
Exit.
Endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:02:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555908#M582518</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-07-23T14:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Read Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555909#M582519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not possible to use OR command on read but there are different approches to acheive this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sairam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:06:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555909#M582519</guid>
      <dc:creator>former_member196280</dc:creator>
      <dc:date>2007-07-23T14:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Read Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555910#M582520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Praveena,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is possible within Loop .. endloop.&lt;/P&gt;&lt;P&gt;You can loop in the internal table and can come out of it, when u find the required record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sujatha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Sujatha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:08:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555910#M582520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T14:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Read Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555911#M582521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying the Search Key&lt;/P&gt;&lt;P&gt;The search key may be either the table key or another key.&lt;/P&gt;&lt;P&gt;Using the Table Key&lt;/P&gt;&lt;P&gt;To use the table key of &amp;lt;itab&amp;gt; as a search key, enter &amp;lt;key&amp;gt; as follows:&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; FROM &amp;lt;wa&amp;gt; &amp;lt;result&amp;gt;.&lt;/P&gt;&lt;P&gt;or as follows&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; WITH TABLE KEY &amp;lt;k1&amp;gt; = &amp;lt;f1&amp;gt; ... &amp;lt;kn&amp;gt; = &amp;lt;fn&amp;gt; &amp;lt;result&amp;gt;.&lt;/P&gt;&lt;P&gt;In the first case, &amp;lt;wa&amp;gt; must be a work area compatible with the line type of &amp;lt;itab&amp;gt;. The values&lt;/P&gt;&lt;P&gt;of the key fields are taken from the corresponding components of the work area.&lt;/P&gt;&lt;P&gt;In the second case, you have to supply the values of each key field explicitly. If you do not know&lt;/P&gt;&lt;P&gt;the name of one of the key fields until runtime, you can specify it as the content of a field &amp;lt;ni&amp;gt;&lt;/P&gt;&lt;P&gt;using the form (&amp;lt;ni&amp;gt;) = &amp;lt;fi&amp;gt;. If the data types of &amp;lt;fi&amp;gt; are not compatible with the key fields, the&lt;/P&gt;&lt;P&gt;system converts them.&lt;/P&gt;&lt;P&gt;The system searches for the relevant lines as follows:&lt;/P&gt;&lt;P&gt;  Standard tables&lt;/P&gt;&lt;P&gt;Linear search, where the runtime is in linear relation to the number of table entries.&lt;/P&gt;&lt;P&gt;  Sorted tables&lt;/P&gt;&lt;P&gt;Binary search, where the runtime is in logarithmic relation to the number of table entries.&lt;/P&gt;&lt;P&gt;  Hashed tables&lt;/P&gt;&lt;P&gt;The entry is found using the hash algorithm of the internal table. The runtime is&lt;/P&gt;&lt;P&gt;independent of the number of table entries.&lt;/P&gt;&lt;P&gt;Using a Different Search Key&lt;/P&gt;&lt;P&gt;To use a key other than the table key as a search key, enter &amp;lt;key&amp;gt; as follows:&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; WITH KEY = &amp;lt;f&amp;gt; &amp;lt;result&amp;gt;.&lt;/P&gt;&lt;P&gt;or as follows&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;itab&amp;gt; WITH KEY &amp;lt;k1&amp;gt; = &amp;lt;f1&amp;gt; ... &amp;lt;kn&amp;gt; = &amp;lt;fn&amp;gt; &amp;lt;result&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first case, the whole line of the internal table is used as the search key. The contents of the entire table line are compared with the contents of field &amp;lt;f&amp;gt;. If &amp;lt;f&amp;gt; is not compatible with the line type of the table, the value is converted into the line type. The search key allows you to find entries in internal tables that do not have a structured line type, that is, where the line is a single field or an internal table type.&lt;/P&gt;&lt;P&gt;In the second case, the search key can consist of any of the table fields &amp;lt;k1&amp;gt;...&amp;lt;kn&amp;gt;. If you do not know the name of one of the components until runtime, you can specify it as the content of a field &amp;lt;ni&amp;gt; using the form (&amp;lt;ni&amp;gt;) = &amp;lt;fi&amp;gt;. If &amp;lt;ni&amp;gt; is empty when the statement is executed, the search field is ignored. If the data types of &amp;lt;fi&amp;gt; are not compatible with the components in the internal table, the system converts them. You can restrict the search to partial fields  by&lt;/P&gt;&lt;P&gt;specifying offset and length.&lt;/P&gt;&lt;P&gt;The search is linear for all table types. The runtime is in linear relation to the number of table lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:33:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555911#M582521</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T14:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Read Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555912#M582522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HAve a look at this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/read.htm" target="test_blank"&gt;http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/read.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ameet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 14:39:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/2555912#M582522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T14:39:08Z</dc:date>
    </item>
  </channel>
</rss>

