<?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: Runtime error while accessing Internal table with Key (ABAP 7.4) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301903#M1990329</link>
    <description>&lt;P&gt;"If a table line is not found, the exception CX_SY_ITAB_LINE_NOT_FOUND is raised. No sy-subrc from expressions, of course."&lt;/P&gt;&lt;P&gt;Please refer to: &lt;A href="https://blogs.sap.com/2013/05/29/abap-news-for-release-740-table-expressions/" target="test_blank"&gt;https://blogs.sap.com/2013/05/29/abap-news-for-release-740-table-expressions/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I Think that you could try someting like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY. 
    DATA(ls_ekko) = gt_ekko[ ebeln = ls_bseg-ebeln ].
   CATCH cx_sy_itab_line_not_found.
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 12 Feb 2021 09:14:47 GMT</pubDate>
    <dc:creator>luis_sismeiro</dc:creator>
    <dc:date>2021-02-12T09:14:47Z</dc:date>
    <item>
      <title>Runtime error while accessing Internal table with Key (ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301902#M1990328</link>
      <description>&lt;P&gt;Dear Experts,&lt;/P&gt;
  &lt;P&gt;With some reference, I have written below statement instead of normal Read statement to get an entry from an Internal table with some Key. But as the entry not existing with the passed key, process goes to runtime error. &lt;/P&gt;
  &lt;P&gt;ABAP Statement:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt; DATA(ls_ekko) = gt_ekko[ ebeln = ls_bseg-ebeln ].
 IF sy-subrc = 0.
   ls_output = VALUE zncms0002( bedat = ls_ekko-bedat ).
 ENDIF.

"In the above statement LS_BSEG-EBELN is blank. &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Runtime Error:&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;The reason for the exception is: Access failed for table "GT_EKKO". Access method: "KEY". Line index (for "INDEX" access) / key name (for "KEY" access): "&amp;lt;free key&amp;gt;". Key values: " " " " " " " "&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;Can anyone please let me know how can we overcome this runtime error and use as general READ statement? &lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 08:30:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301902#M1990328</guid>
      <dc:creator>VijayaKrishnaG</dc:creator>
      <dc:date>2021-02-12T08:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime error while accessing Internal table with Key (ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301903#M1990329</link>
      <description>&lt;P&gt;"If a table line is not found, the exception CX_SY_ITAB_LINE_NOT_FOUND is raised. No sy-subrc from expressions, of course."&lt;/P&gt;&lt;P&gt;Please refer to: &lt;A href="https://blogs.sap.com/2013/05/29/abap-news-for-release-740-table-expressions/" target="test_blank"&gt;https://blogs.sap.com/2013/05/29/abap-news-for-release-740-table-expressions/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I Think that you could try someting like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY. 
    DATA(ls_ekko) = gt_ekko[ ebeln = ls_bseg-ebeln ].
   CATCH cx_sy_itab_line_not_found.
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2021 09:14:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301903#M1990329</guid>
      <dc:creator>luis_sismeiro</dc:creator>
      <dc:date>2021-02-12T09:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime error while accessing Internal table with Key (ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301904#M1990330</link>
      <description>&lt;P&gt;Hi Luis,&lt;/P&gt;&lt;P&gt;Thanks for your quick response / solution and blog. Now I would like to ask, can these statement meant for replacement of Read statement? And is there any performance differences in Read and the  above statement, as we are not using any search techniques (Binary)?  &lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 09:32:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301904#M1990330</guid>
      <dc:creator>VijayaKrishnaG</dc:creator>
      <dc:date>2021-02-12T09:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime error while accessing Internal table with Key (ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301905#M1990331</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;14434537ae0441799e327b92f10dfe46&lt;/SPAN&gt; suggested a good blog in the comment.&lt;/P&gt;&lt;P&gt;There is also information to read &lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abentable_expressions.htm" target="_blank"&gt;in the ABAP documentation&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The cx_sy_itab_line_not_found is what is thrown when no line is found, instead of sy-subrc for READ TABLE, so you need to catch that one as suggested.&lt;/P&gt;&lt;P&gt;There is also the possibility to using the value operator here, depending on your exact use case/need:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ekko_bedat = VALUE #( gt_ekko[ ebeln = ls_bseg-ebeln ]-bedat OPTIONAL ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Using the OPTIONAL parameter will NOT cause the exception to be thrown if no line is found. Instead the 'ekko_bedat' will be INITIAL (whatever that is for the current data type) so you would still have to check it before you use it further down in the code...&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 13:17:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301905#M1990331</guid>
      <dc:creator>joltdx</dc:creator>
      <dc:date>2021-02-12T13:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime error while accessing Internal table with Key (ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301906#M1990332</link>
      <description>&lt;P&gt;or&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ls_output = VALUE #( bedat = VALUE #( gt_ekko[ ebeln = ls_bseg-ebeln ]-bedat OPTIONAL ) ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2021 13:19:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301906#M1990332</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-02-12T13:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime error while accessing Internal table with Key (ABAP 7.4)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301907#M1990333</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I would like to say &lt;SPAN class="mention-scrubbed"&gt;14434537ae0441799e327b92f10dfe46&lt;/SPAN&gt;'s comment is also very much helpful to resolve my issue. Thank you! &lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 12:54:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-while-accessing-internal-table-with-key-abap-7-4/m-p/12301907#M1990333</guid>
      <dc:creator>VijayaKrishnaG</dc:creator>
      <dc:date>2021-02-17T12:54:37Z</dc:date>
    </item>
  </channel>
</rss>

