<?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 statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525323#M240718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Surely you can use the code but just wanted to point out to you that irrespective of your IF condition the field in it_xx-field would have the value from zbseg on successful read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anurag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Aug 2006 13:12:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-15T13:12:11Z</dc:date>
    <item>
      <title>Read table statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525316#M240711</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 follow statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT it_bsik.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING it_bsik TO it_xx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE zbseg WITH KEY bukrs = it_bsik-bukrs&lt;/P&gt;&lt;P&gt;                              belnr = it_zbsik-belnr&lt;/P&gt;&lt;P&gt;                              gjahr = it_zbsik-gjahr&lt;/P&gt;&lt;P&gt;                              buzei = it_zbsik-buzei.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING zbseg TO it_xx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to move into the it_xx some fields of zbseg depending on the number of the account (zbseg-hkont)&lt;/P&gt;&lt;P&gt;Can I use the follow statement:&lt;/P&gt;&lt;P&gt; LOOP AT it_bsik.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    MOVE-CORRESPONDING it_bsik TO it_xx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE zbseg WITH KEY bukrs = it_bsik-bukrs&lt;/P&gt;&lt;P&gt;                              belnr = it_zbsik-belnr&lt;/P&gt;&lt;P&gt;                              gjahr = it_zbsik-gjahr&lt;/P&gt;&lt;P&gt;                              buzei = it_zbsik-buzei.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING zbseg TO it_xx.&lt;/P&gt;&lt;P&gt;        IF zbseg-hkont = '11111111'.&lt;/P&gt;&lt;P&gt;           it_xx-field = zbseg-field.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;Cristina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2006 12:58:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525316#M240711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-15T12:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read table statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525317#M240712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, You can use that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Cheers&lt;/P&gt;&lt;P&gt; VJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2006 13:00:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525317#M240712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-15T13:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read table statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525318#M240713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many Thanks VJ !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2006 13:06:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525318#M240713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-15T13:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Read table statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525319#M240714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Cristina&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   If the fieldname and data type if same in both &lt;/P&gt;&lt;P&gt;structures zbseg and it_xx, it will be copied &lt;/P&gt;&lt;P&gt;irrespective of the account number via &lt;/P&gt;&lt;P&gt;move-corresponding statement. If both fields are not &lt;/P&gt;&lt;P&gt;same then the explicit assignment will do the work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2006 13:07:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525319#M240714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-15T13:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Read table statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525320#M240715</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;It would be better if you sort ZBSEG and use Binary search for performance point of view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ZBSEG by BUKRS BELNR GJAHR BUZEI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_bsik.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING it_bsik TO it_xx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE zbseg WITH KEY bukrs = it_bsik-bukrs&lt;/P&gt;&lt;P&gt;belnr = it_zbsik-belnr&lt;/P&gt;&lt;P&gt;gjahr = it_zbsik-gjahr&lt;/P&gt;&lt;P&gt;buzei = it_zbsik-buzei &amp;lt;b&amp;gt;BINARY SEARCH&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING zbseg TO it_xx.&lt;/P&gt;&lt;P&gt;IF zbseg-hkont = '11111111'.&lt;/P&gt;&lt;P&gt;it_xx-field = zbseg-field.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2006 13:07:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525320#M240715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-15T13:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read table statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525321#M240716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi cristina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_bsik into it_xx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MOVE-CORRESPONDING it_bsik TO it_xx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE zbseg WITH KEY bukrs = it_bsik-bukrs&lt;/P&gt;&lt;P&gt;belnr = it_zbsik-belnr&lt;/P&gt;&lt;P&gt;gjahr = it_zbsik-gjahr&lt;/P&gt;&lt;P&gt;buzei = it_zbsik-buzei.&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING zbseg TO it_xx.&lt;/P&gt;&lt;P&gt;IF zbseg-hkont = '11111111'.&lt;/P&gt;&lt;P&gt;it_xx-field = zbseg-field.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2006 13:08:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525321#M240716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-15T13:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Read table statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525322#M240717</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;Yes, you can move required fields based on conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we do follow programming standards, it would be better if we add few statemetns to your code. This improves the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Outside the loop, we have to sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SORT ZBSEG BY BELNR GJAHR BUZEI.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLEAR : ZBSEG.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;READ TABLE zbseg WITH KEY bukrs = it_bsik-bukrs&lt;/P&gt;&lt;P&gt;belnr = it_zbsik-belnr&lt;/P&gt;&lt;P&gt;gjahr = it_zbsik-gjahr&lt;/P&gt;&lt;P&gt;buzei = it_zbsik-buzei&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;BINARY SEARCH.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING zbseg TO it_xx.&lt;/P&gt;&lt;P&gt;IF zbseg-hkont = '11111111'.&lt;/P&gt;&lt;P&gt;it_xx-field = zbseg-field.&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;Sailaja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2006 13:08:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525322#M240717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-15T13:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read table statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525323#M240718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Surely you can use the code but just wanted to point out to you that irrespective of your IF condition the field in it_xx-field would have the value from zbseg on successful read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anurag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2006 13:12:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-statement/m-p/1525323#M240718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-15T13:12:11Z</dc:date>
    </item>
  </channel>
</rss>

