<?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 statement with multiple key values in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121392#M1974271</link>
    <description>&lt;P&gt;you can't use a single READ TABLE for this task. Try&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT WHERE condition.  
  EXIT.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;you can check sy-subrc after the LOOP.&lt;/P&gt;&lt;P&gt;Also try to push this logic to your database query.&lt;/P&gt;&lt;P&gt;JNN&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2019 18:46:13 GMT</pubDate>
    <dc:creator>nomssi</dc:creator>
    <dc:date>2019-09-17T18:46:13Z</dc:date>
    <item>
      <title>Read statement with multiple key values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121391#M1974270</link>
      <description>&lt;P&gt;How can we write in read statement with one field multiple key values ...&lt;/P&gt;
  &lt;P&gt;How to write the statement can any one help &lt;/P&gt;
  &lt;P&gt;I wrote like the below code but those are not working.&lt;/P&gt;
  &lt;P&gt;1.Read table itab into wa with key = 's' or 'n'.&lt;/P&gt;
  &lt;P&gt;2.read table itab into wa with key = (' s' or 'no' )&lt;/P&gt;
  &lt;P&gt;Thanks in advance,&lt;/P&gt;
  &lt;P&gt;Shivani.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 18:36:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121391#M1974270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-09-17T18:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement with multiple key values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121392#M1974271</link>
      <description>&lt;P&gt;you can't use a single READ TABLE for this task. Try&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT WHERE condition.  
  EXIT.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;you can check sy-subrc after the LOOP.&lt;/P&gt;&lt;P&gt;Also try to push this logic to your database query.&lt;/P&gt;&lt;P&gt;JNN&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 18:46:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121392#M1974271</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2019-09-17T18:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement with multiple key values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121393#M1974272</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;You cannot write a statement as such. &lt;/P&gt;&lt;P&gt;Instead you can prioritize your key values, for example if you feel reading the internal with Key value S is your first priority then you can read the same. If The read is successful then proceed else read the same table again with N. Below snippet is for reference. &lt;/P&gt;&lt;P&gt;Read itab into WA with key field = S. &lt;/P&gt;&lt;P&gt;If sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;Proceed. &lt;/P&gt;&lt;P&gt;Else. &lt;/P&gt;&lt;P&gt;Read table into wa with key field = N. &lt;/P&gt;&lt;P&gt;End if. &lt;/P&gt;&lt;P&gt;In case your priority is reversed then use the vice versa of the same as given above. &lt;/P&gt;&lt;P&gt;Kindly note you cannot use OR condition in read statements. &lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 19:02:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121393#M1974272</guid>
      <dc:creator>former_member1716</dc:creator>
      <dc:date>2019-09-17T19:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement with multiple key values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121394#M1974273</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think if you search in this forum you &lt;A href="https://answers.sap.com/questions/6912473/how-to-assigne-multiple-value-in-key-of-read-table.html"&gt;can find the answer&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 19:06:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121394#M1974273</guid>
      <dc:creator>Nawanandana</dc:creator>
      <dc:date>2019-09-17T19:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement with multiple key values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121395#M1974274</link>
      <description>&lt;P&gt;READ TABLE is used to process single record.&lt;/P&gt;&lt;P&gt;You may try with LOOP AT WHERE clause.&lt;/P&gt;&lt;P&gt;Previously it was done with &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ TABLE itab { { }               &lt;BR /&gt;| { WITH KEY dobj }                &lt;BR /&gt;| { WITH KEY = dobj } } [BINARY SEARCH] result.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is obsolete now. You can read more on Binary search and alternatives &lt;A href="https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapread_table_obsolet.htm"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:44:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-multiple-key-values/m-p/12121395#M1974274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-09-18T15:44:34Z</dc:date>
    </item>
  </channel>
</rss>

