<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372348#M1993727</link>
    <description>&lt;P&gt;Or&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT IT_FINAL REFERENCE INTO DATA(line).
  READ TABLE IT_QAVE1 INTO WA_QAVE1
    WITH KEY PRUEFLOS = WA_FINAL-&amp;gt;PRUEFLOS.
  CHECK sy-subrc = 0. 
  line-&amp;gt;VCODE = WA_QAVE1-VCODE.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 13 Mar 2021 08:55:10 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2021-03-13T08:55:10Z</dc:date>
    <item>
      <title>READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372342#M1993721</link>
      <description>&lt;P&gt;HI EXPERT&lt;/P&gt;
  &lt;P&gt;This is my code that I display using ALV REPORT . My data is correct just before I get into the reading table, but after I get into READ TABLE Displays data incorrectly. Why does it not enter the data correctly in the final table?&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECT QALS~PRUEFLOS  QALS~KTEXTLOS 
       QALS~AUFNR  QASR~VORGLFNR 
       QALS~MATNR  MAKT~MAKTX 

  INTO TABLE IT_FINAL
  FROM QALS
  INNER JOIN QASR ON QASR~PRUEFLOS = QALS~PRUEFLOS
  INNER JOIN MAKT ON QALS~MATNR = MAKT~MATNR
  WHERE QALS~ART = '03'
  AND QASR~VORGLFNR IN ('22' , '23' , '24')
  AND MAKT~SPRAS = 'EN' .

IF IT_FINAL IS NOT INITIAL .
SELECT PRUEFLOS VCODE
  INTO TABLE IT_QAVE1
  FROM QAVE
  FOR ALL ENTRIES IN IT_FINAL
  WHERE PRUEFLOS = IT_FINAL-PRUEFLOS .

  LOOP AT IT_FINAL INTO WA_FINAL .
  READ TABLE IT_QAVE1 INTO WA_QAVE1 WITH KEY PRUEFLOS = WA_FINAL-PRUEFLOS .
  WA_FINAL-VCODE = WA_QAVE1-VCODE .
  CLEAR : WA_QAVE1 ,WA_FINAL .

  ENDLOOP.
  ENDIF.
&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Mar 2021 17:31:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372342#M1993721</guid>
      <dc:creator>former_member713390</dc:creator>
      <dc:date>2021-03-12T17:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372343#M1993722</link>
      <description>&lt;P&gt;You want to update the VCODE value in your IT_FINAL table? Then you have to use either a field-symbol or a reference. The loop "transfers" the data just into a structure; if you update the structure and not no update on the internal table, the internal table is not changed.&lt;/P&gt;&lt;P&gt;One option using a reference is like following (your_line_type needs to be replaced with the type you used for your workarea; if you have an NW system &amp;gt; 7.40 you could use a lot more modern syntax, but as I do not know if you have that option, I sticked with the old stuff):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  DATA lr_final TYPE REF TO your_line_type.

  LOOP AT IT_FINAL REFERENCE INTO lr_final.
    READ TABLE IT_QAVE1 INTO WA_QAVE1 WITH KEY PRUEFLOS = WA_FINAL-PRUEFLOS.
    IF sy-subrc = 0.
      lr_final-vcode = wa_qave1-vcode.&lt;BR /&gt;    ENDIF.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Mar 2021 17:54:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372343#M1993722</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2021-03-12T17:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372344#M1993723</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT IT_FINAL INTO WA_FINAL .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is only making a copy if the table line into WA_FINAL so you are only assigning the WA_QAVE1-VCODE to that copy. Also on the next line you are clearing it again, and you're not expecting the line to be cleared in the table, I suppose...&lt;/P&gt;&lt;P&gt;You should prefer to declare a field-symbol instead. That way you can change the table line data inside of the LOOP. Make sure not to clear it though. And for good measure, I recommend checking sy-subrc after the READ TABLE.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT IT_FINAL ASSIGNING FIELD-SYMBOL(&amp;lt;wa_final&amp;gt;).
  READ TABLE IT_QAVE1 INTO WA_QAVE1 WITH KEY PRUEFLOS = WA_FINAL-PRUEFLOS .
  IF sy-subrc = 0.
    &amp;lt;wa_final&amp;gt;-VCODE = WA_QAVE1-VCODE.
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abaploop_at_itab_result.htm" target="_blank"&gt;ABAP Documentation, look for ASSIGNING.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Addition: I don't really know the tables QAVE and QALS and what you need, but there is a chance that you can JOIN them instead of doing the FOR ALL ENTRIES and LOOP. But since you are not use the full key of QAVE so you might get more lines from that one...&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 17:57:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372344#M1993723</guid>
      <dc:creator>joltdx</dc:creator>
      <dc:date>2021-03-12T17:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372345#M1993724</link>
      <description>&lt;P&gt;The origin of this issue can be found easily by using the &lt;STRONG&gt;debugger&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 05:10:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372345#M1993724</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-03-13T05:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372346#M1993725</link>
      <description>&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;LOOPAT IT_FINAL ASSIGNINGFIELD-SYMBOL(&amp;lt;wa_final&amp;gt;).&lt;/P&gt;&lt;P&gt;READTABLE IT_QAVE1 INTO WA_QAVE1 WITHKEY PRUEFLOS = WA_FINAL-PRUEFLOS.&lt;/P&gt;&lt;P&gt;IFsy-subrc =0.&lt;/P&gt;&lt;P&gt;&amp;lt;wa_final&amp;gt;-VCODE = WA_QAVE1-VCODE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;append required data to final inernal table &lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 05:12:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372346#M1993725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2021-03-13T05:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372347#M1993726</link>
      <description>&lt;P&gt;Hi Afsane Salehi,&lt;/P&gt;&lt;P&gt;When we works with READ TABLE , we must have to do Sorting and binary search. Below is the Updated code . Check Once.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT IT_FINAL.

LOOP AT IT_FINAL INTO WA_FINAL .

READ TABLE IT_QAVE1 INTO WA_QAVE1 WITH KEY PRUEFLOS = WA_FINAL-PRUEFLOS BINARY SEARCH .
  WA_FINAL-VCODE = WA_QAVE1-VCODE .

CLEAR: WA_QAVE1 ,WA_FINAL .

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Chaitali Pandya&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 06:49:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372347#M1993726</guid>
      <dc:creator>former_member723794</dc:creator>
      <dc:date>2021-03-13T06:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: READ TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372348#M1993727</link>
      <description>&lt;P&gt;Or&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT IT_FINAL REFERENCE INTO DATA(line).
  READ TABLE IT_QAVE1 INTO WA_QAVE1
    WITH KEY PRUEFLOS = WA_FINAL-&amp;gt;PRUEFLOS.
  CHECK sy-subrc = 0. 
  line-&amp;gt;VCODE = WA_QAVE1-VCODE.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Mar 2021 08:55:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/12372348#M1993727</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-03-13T08:55:10Z</dc:date>
    </item>
  </channel>
</rss>

