<?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: OR condition in key while reading internal table.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110597#M982825</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must use a LOOP in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at i_cust 
        where domvalue = it_kna1-NAME1
             or  domvalue = it_kna1-name2.
* Do something
exit.  " now exit if at least one line has been read
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&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>Thu, 03 Jul 2008 15:56:02 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2008-07-03T15:56:02Z</dc:date>
    <item>
      <title>OR condition in key while reading internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110595#M982823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to reading internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; READ TABLE i_cust WITH KEY domvalue = it_kna1-NAME1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to read the same table with or condition in key like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; domvalue = it_kna1-name1 or domvalue = it_kna1-name2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do or condition for Keys ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 15:53:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110595#M982823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T15:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: OR condition in key while reading internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110596#M982824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can only use READ TABLE statement with equality condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can achieve the desired result in the following way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
READ TABLE i_cust WITH KEY domvalue = it_kna1-NAME1.
if sy-subrc ne 0.
READ TABLE i_cust WITH KEY domvalue = it_kna1-NAME2.
 if sy-subrc = 0.
    PERFORM subroutine1.
 endif.
else.
  PERFORM subroutine1.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 15:54:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110596#M982824</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T15:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: OR condition in key while reading internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110597#M982825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must use a LOOP in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at i_cust 
        where domvalue = it_kna1-NAME1
             or  domvalue = it_kna1-name2.
* Do something
exit.  " now exit if at least one line has been read
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&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>Thu, 03 Jul 2008 15:56:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110597#M982825</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-07-03T15:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: OR condition in key while reading internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110598#M982826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my case I will have value in either of fields, so I want to read the table with that key which has the value..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 15:58:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110598#M982826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T15:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: OR condition in key while reading internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110599#M982827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can achieve the desired result in the following way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

READ TABLE i_cust WITH KEY domvalue = it_kna1-NAME1.
if sy-subrc ne 0.
READ TABLE i_cust WITH KEY domvalue = it_kna1-NAME2.
 if sy-subrc = 0.
    PERFORM subroutine1.
 endif.
else.
  PERFORM subroutine1.
endif.
 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 16:00:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110599#M982827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-03T16:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: OR condition in key while reading internal table..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110600#M982828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, then you could use a field symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;field-symbols: &amp;lt;fs_name&amp;gt; type any.

if it_kna1-NAME1 is not initial.
 assign it_kna1-NAME1 to &amp;lt;fs_name&amp;gt;.
elseif it_kna1-NAME2 is not initial.
 assign it_kna1-NAME2 to &amp;lt;fs_name&amp;gt;.
endif.

READ TABLE i_cust WITH KEY domvalue = &amp;lt;fs_name&amp;gt;.
if sy-subrc = 0.

endif.&lt;/CODE&gt;&lt;/PRE&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;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 16:14:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/or-condition-in-key-while-reading-internal-table/m-p/4110600#M982828</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-07-03T16:14:55Z</dc:date>
    </item>
  </channel>
</rss>

