<?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 (or) loop statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684833#M1101409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;if you loop the single record internal table you might end up in not processing the entire records.&lt;/P&gt;&lt;P&gt;as the case like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_vbak.&lt;/P&gt;&lt;P&gt;read table i_vbap.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;normally vbap contains more line items for a record in vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then loop runs only single time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Ramchander Rao.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Nov 2008 05:15:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-12T05:15:59Z</dc:date>
    <item>
      <title>read (or) loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684828#M1101404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai abapers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iam selecting  some data base tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create some internal tables with their batabase tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all tables select quires completed by using for all entries condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;problem is ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some tables contains multiple records and some tables contains single  records. so in this case &lt;/P&gt;&lt;P&gt; move into final table , i can take multiple records  tables by using loop stament and single record tables &lt;/P&gt;&lt;P&gt;by using read stament.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but single record table fields repeted by same value along with multiple fields table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i rectify this problem ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my requirement is single field value only comes once , but not repeated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 04:59:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684828#M1101404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-12T04:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: read (or) loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684829#M1101405</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;use delete adjacent duplicates comparing the fields which you want to show only once in the repor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Lalit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 05:05:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684829#M1101405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-12T05:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: read (or) loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684830#M1101406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Trt to select the data based on key fields from the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 05:05:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684830#M1101406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-12T05:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: read (or) loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684831#M1101407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raja,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you donot want this happen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do it like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***note : if you want this internal table data for further processing move the whole data into another similar internal table &lt;/P&gt;&lt;P&gt;itab2[] = itab1[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take care of sy-tabix as it changes once after the loop statement and once per the read statement.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab1 with key f1 = itab-f1.&lt;/P&gt;&lt;P&gt;if sy-subrc is initial.&lt;/P&gt;&lt;P&gt;move-corresponding itab1 to i_final.&lt;/P&gt;&lt;P&gt;****now you delete the record from the itab1 &lt;/P&gt;&lt;P&gt;delete itab1 index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will meet your purpose.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Ramchander Rao.Krishnamraju&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;&lt;/P&gt;&lt;P&gt;or you can try this.&lt;/P&gt;&lt;P&gt;you can use the control break statements as follows.&lt;/P&gt;&lt;P&gt;in this case you dont need the delete the record of the internal table&lt;/P&gt;&lt;P&gt;please note here all the character fields become stars from right of the key field.&lt;/P&gt;&lt;P&gt;only numeric fields are available.&lt;/P&gt;&lt;P&gt;sort itab by f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at new itab-f1.&lt;/P&gt;&lt;P&gt;read table itab1 with key f1 = itab-f1.&lt;/P&gt;&lt;P&gt;if sy-subrc is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;Edited by: ramchander krishnamraju on Nov 12, 2008 6:13 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ramchander krishnamraju on Nov 12, 2008 6:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 05:12:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684831#M1101407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-12T05:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: read (or) loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684832#M1101408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jus try this...If u hv 2 internal tables, one wid multiple records and the other wid single records, then use 'loop' for single records table and 'read' for multiple records table....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 05:12:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684832#M1101408</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-12T05:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: read (or) loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684833#M1101409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;if you loop the single record internal table you might end up in not processing the entire records.&lt;/P&gt;&lt;P&gt;as the case like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_vbak.&lt;/P&gt;&lt;P&gt;read table i_vbap.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;normally vbap contains more line items for a record in vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then loop runs only single time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Ramchander Rao.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 05:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684833#M1101409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-12T05:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: read (or) loop statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684834#M1101410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ur final internal table if some data is rapeating , jst sort the internal table based upon the comparing fields and use delete adjacent dupilcate comparing &amp;lt;fields&amp;gt; .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 06:09:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-or-loop-statements/m-p/4684834#M1101410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-12T06:09:07Z</dc:date>
    </item>
  </channel>
</rss>

