<?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 table with syntax error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770027#M645383</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;I used read and if option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Oct 2007 12:58:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-02T12:58:39Z</dc:date>
    <item>
      <title>Read table with syntax error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770022#M645378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to have this in my report in ABAP 7:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          READ TABLE ti_prococolos WITH KEY&lt;/P&gt;&lt;P&gt;                               protocol = lc_protocol&lt;/P&gt;&lt;P&gt;                               status    = 'abc'&lt;/P&gt;&lt;P&gt;                               status    = 'ced'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I receive the following error, when verifying the syntax:&lt;/P&gt;&lt;P&gt;Key field "STATUS" has been used more than once. This is not allowed .	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2007 13:26:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770022#M645378</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-14T13:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Read table with syntax error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770023#M645379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The READ statement is used to read a specific row of the internal table, in this case it appears that you are saying that you want a record if the STATUS is either abc or def.  You can't do that with the READ.  You would need to use the LOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at ti_prococolos where protocol = lc_protocal
                                    and ( status = 'abc' or status = 'ced' ).

* do what ever here, and EXIT after since you only want one row.
EXIT.

endloop.&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>Fri, 14 Sep 2007 13:29:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770023#M645379</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-09-14T13:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Read table with syntax error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770024#M645380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you read with KEY, the field can have only one value for the FIELD.&lt;/P&gt;&lt;P&gt;In your case, you've to open a  loop or use two separate  READ statements ie one for each value..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2007 13:31:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770024#M645380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-14T13:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Read table with syntax error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770025#M645381</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;Please try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ranges: r_status for ti_prococolos-status.

r_status-sign = 'I'.
r_status-option ='EQ'.
r_status-low = 'abc'.
append r_status.

r_status-sign = 'I'.
r_status-option ='EQ'.
r_status-low = 'ced'.
append r_status.

READ TABLE ti_prococolos WITH KEY
protocol = lc_protocol
status in r_status.
&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;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2007 13:32:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770025#M645381</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2007-09-14T13:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Read table with syntax error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770026#M645382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;sort ti_prococolos by protocol status.
READ TABLE ti_prococolos WITH KEY
  protocol = lc_protocol
  status = 'abc'
  BINARY SEARCH.

IF sy-subrc &amp;lt;&amp;gt; 0.
  READ TABLE ti_prococolos WITH KEY
    protocol = lc_protocol
    status = 'ced'
    binary search.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2007 14:24:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770026#M645382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-14T14:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Read table with syntax error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770027#M645383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;I used read and if option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2007 12:58:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-with-syntax-error/m-p/2770027#M645383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-02T12:58:39Z</dc:date>
    </item>
  </channel>
</rss>

