<?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 internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171286#M123176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sai,&lt;/P&gt;&lt;P&gt;  What exactly is your requiremnt ? What u want to do if the read statement fails. Currently ur program is coded to append blank lines and its doing it correctly ! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.--&amp;gt; not working      &lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING b_tab TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here b_tab will have no value coz sy-surc &amp;lt;&amp;gt; 0 , so its appending a blank line. If you want the program to modify b_tab based on the datum (since u are looping at datum) u might have to use modify index or modify using statment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Feb 2006 14:44:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-09T14:44:14Z</dc:date>
    <item>
      <title>read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171282#M123172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FORM time_division.

  help = 1.

  LOOP AT datum.

    CONCATENATE 'itab-datum' help INTO feld_datum.
    CONCATENATE 'itab-menge' help INTO feld_menge.
    ASSIGN:
        (feld_datum) TO &amp;lt;field1&amp;gt;,
        (feld_menge) TO &amp;lt;field2&amp;gt;.


    READ TABLE b_tab WITH KEY gltrp = datum-low BINARY SEARCH.
    IF sy-subrc EQ 0.---&amp;gt; working fine
      MOVE-CORRESPONDING b_tab TO itab.
      &amp;lt;field1&amp;gt; = datum-low.
      &amp;lt;field2&amp;gt; = b_tab-menge.
*      MOVE datum-low TO itab-datum1.
*      MOVE b_tab-menge TO itab-menge1.
      COLLECT itab.
      clear itab.
    ELSE.--&amp;gt; not working
      MOVE-CORRESPONDING b_tab TO itab.
      &amp;lt;field1&amp;gt; = datum-low.
      &amp;lt;field2&amp;gt; = 0.
      collect itab.
      clear itab.
    ENDIF.
    help = help + 1.
  ENDLOOP.
  clear itab.
ENDFORM.                    " time_division
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the problem ín the code is if the read statement is successfull then the program working fine. but when not successfull(move-corresponding not working) its appending new lines instead of modifying (bcoz its not successfull).&lt;/P&gt;&lt;P&gt;Please anybody tell me how to work with this problem.&lt;/P&gt;&lt;P&gt;Any help will be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;chandu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 13:55:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171282#M123172</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T13:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171283#M123173</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;  IF sy-subrc = 0. then U'lll definitely have some &lt;/P&gt;&lt;P&gt;values in the internal table.&lt;/P&gt;&lt;P&gt;But If sy-subrc fails then &amp;lt;b&amp;gt;b_tab&amp;lt;/b&amp;gt; will not have &lt;/P&gt;&lt;P&gt;any values. and UR doing the same below which appends a &lt;/P&gt;&lt;P&gt;blank line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.--&amp;gt; not working&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING b_tab TO itab.&lt;/P&gt;&lt;P&gt;      &amp;lt;field1&amp;gt; = datum-low.&lt;/P&gt;&lt;P&gt;      &amp;lt;field2&amp;gt; = 0.&lt;/P&gt;&lt;P&gt;      collect itab.&lt;/P&gt;&lt;P&gt;      clear itab.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;GSR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 14:26:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171283#M123173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T14:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171284#M123174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't get a hit from B_TAB.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  ELSE.--&amp;gt; not working   
    &amp;lt;b&amp;gt;MOVE-CORRESPONDING b_tab TO itab. &amp;lt;/b&amp;gt;  
    &amp;lt;field1&amp;gt; = datum-low.     
    &amp;lt;field2&amp;gt; = 0.     
    collect itab.   
    clear itab.  
  ENDIF.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What exactly to you expect to move to ITAB.  If its not found what to you want to put into ITAB./&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, 09 Feb 2006 14:27:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171284#M123174</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-09T14:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171285#M123175</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;As there is no &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;clear: b_tab.&amp;lt;/b&amp;gt; prior to &lt;/P&gt;&lt;P&gt;read table b_tab....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;values are moving to itab from b_tab though read statement is unsuccessful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING b_tab TO itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, you might be getting wrong results.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sailaja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 14:31:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171285#M123175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T14:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171286#M123176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sai,&lt;/P&gt;&lt;P&gt;  What exactly is your requiremnt ? What u want to do if the read statement fails. Currently ur program is coded to append blank lines and its doing it correctly ! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.--&amp;gt; not working      &lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING b_tab TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here b_tab will have no value coz sy-surc &amp;lt;&amp;gt; 0 , so its appending a blank line. If you want the program to modify b_tab based on the datum (since u are looping at datum) u might have to use modify index or modify using statment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 14:44:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/1171286#M123176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T14:44:14Z</dc:date>
    </item>
  </channel>
</rss>

