<?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: need read statment in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928085#M689903</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;Try like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table i_kna1 WITH KEY kunnr = i_knvh-kunnr.&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;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Oct 2007 10:30:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-24T10:30:36Z</dc:date>
    <item>
      <title>need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928081#M689899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi frnds,&lt;/P&gt;&lt;P&gt;I have 2 internal tables, i_kna1 and i_knvh.&lt;/P&gt;&lt;P&gt;in i_kna1 i have kunnr and name1 are fields. In i_knvh i have kunnr. i want to read the of i_knvh kunnr records from i_kna1 table, because i want to merge the i_knvh kunnr into kna1 name plz advice it. and how to store this in a new internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 10:24:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928081#M689899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T10:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928082#M689900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP AT i_knvh into wa_knvh.&lt;/P&gt;&lt;P&gt; LOOP AT i_kna1 INTO wa_kna1 WHERE kunnr = wa_knvh-kunnr.&lt;/P&gt;&lt;P&gt;   your logic.&lt;/P&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghavendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 10:26:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928082#M689900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T10:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928083#M689901</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;You can modify i_kna1 using the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort:  i_kna1 by kunnr,&lt;/P&gt;&lt;P&gt;        i_knvh  by kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_kna1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        READ TABLE i_knvh INTO wa_knvh WITH KEY kunnr = wa_kna1-kunnr&lt;/P&gt;&lt;P&gt;                                                   BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*move fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify i_kna1 from wa_kna1 index lv_index &lt;/P&gt;&lt;P&gt;transporting f1 f2 f3&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;regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 10:28:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928083#M689901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T10:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928084#M689902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at  i_knvh.&lt;/P&gt;&lt;P&gt;read table i_kna1 with key kunnr = i_knvh-kunnr.&lt;/P&gt;&lt;P&gt;*Move the data from i_knvh and i_kna1 to new table&lt;/P&gt;&lt;P&gt;*append consolidated data into new table.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 10:29:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928084#M689902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T10:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928085#M689903</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;Try like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table i_kna1 WITH KEY kunnr = i_knvh-kunnr.&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;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 10:30:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928085#M689903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T10:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928086#M689904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sheetal plz explain detail&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 10:31:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928086#M689904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T10:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928087#M689905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gowri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can write like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort i_kna1 by kunnr.
sort i_knvh by kunnr.
LOOP AT i_kna1 into wa_kna1.
* This part of code if i_knvh has more than 1 entry for  * i_kna1-kunnr.
  LOOP AT i_knvh into wa_knvh WHERE kunnr = wa_kna1-kunnr.
    concatenate lv_kunnr wa_knvh-kunnr into lv_kunnr.
    AT LAST.
      wa_knv1-kunnr = wa_kna1-kunnr.
      wa_knv1-name1 = lv_kunnr.
      append wa_knv1 to i_knv1.
*     Lets hope that i_knv1 is ur new internal table
      clear wa_knv1.
    ENDAT.
  ENDLOOP.
* This part of code if i_knvh has more than 1 entry for  * i_kna1-kunnr.

* This part of code if i_knvh has 1 entry for 
* i_kna1-kunnr.
  READ TABLE i_knvh with key kunnr = wa_kna1-kunnr binary search.
  IF sy-subrc = 0.
    concatenate lv_kunnr wa_knvh-kunnr into lv_kunnr.
    wa_knv1-kunnr = wa_kna1-kunnr.
    wa_knv1-name1 = lv_kunnr.
    append wa_knv1 to i_knv1.
*   Lets hope that i_knv1 is ur new internal table
    clear wa_knv1.
  ENDIF.
* This part of code if i_knvh has 1 entry for 
* i_kna1-kunnr.
ENDLOOP. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phani.&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Sivapuram Phani Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 10:34:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928087#M689905</guid>
      <dc:creator>PS_1978</dc:creator>
      <dc:date>2007-10-24T10:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928088#M689906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gowri sankar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_knvh.&lt;/P&gt;&lt;P&gt;read table i_kna1 with key kunnr = i_knvh-kunnr.&lt;/P&gt;&lt;P&gt;itabfinal-kunnr = i_knvh -kunnr.&lt;/P&gt;&lt;P&gt;itabfinal-name = i_kna1-name.&lt;/P&gt;&lt;P&gt;append itabfinal.&lt;/P&gt;&lt;P&gt;clear itabfinal.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 10:35:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928088#M689906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T10:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928089#M689907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gowri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For efficiency I would take a look at this code and see if you can use the same type of design for your needs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: s_ekko TYPE ekko.&lt;/P&gt;&lt;P&gt;DATA: v_tabix TYPE sytabix.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs_item&amp;gt; TYPE ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT: t_ekko BY ebeln,&lt;/P&gt;&lt;P&gt;      t_ekpo BY ebeln ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_ekko INTO s_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  AT NEW ebeln.&lt;/P&gt;&lt;P&gt;    WRITE: / s_ekko-ebeln,&lt;/P&gt;&lt;P&gt;             s_ekko-lifnr.&lt;/P&gt;&lt;P&gt;    SKIP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR v_tabix.&lt;/P&gt;&lt;P&gt;    READ TABLE t_ekpo WITH KEY ebeln = s_ekko-ebeln&lt;/P&gt;&lt;P&gt;      BINARY SEARCH&lt;/P&gt;&lt;P&gt;        TRANSPORTING NO FIELDS.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      v_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;      LOOP AT t_ekpo ASSIGNING &amp;lt;fs_item&amp;gt; FROM v_tabix.&lt;/P&gt;&lt;P&gt;        IF &amp;lt;fs_item&amp;gt;-ebeln &amp;lt;&amp;gt; s_ekko-ebeln.&lt;/P&gt;&lt;P&gt;          EXIT.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        WRITE: / &amp;lt;fs_item&amp;gt;-ebelp,&lt;/P&gt;&lt;P&gt;                 &amp;lt;fs_item&amp;gt;-matnr,&lt;/P&gt;&lt;P&gt;                 &amp;lt;fs_item&amp;gt;-menge,&lt;/P&gt;&lt;P&gt;                 &amp;lt;fs_item&amp;gt;-meins,&lt;/P&gt;&lt;P&gt;                 &amp;lt;fs_item&amp;gt;-netpr.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&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;  AT END OF ebeln.&lt;/P&gt;&lt;P&gt;    SKIP.&lt;/P&gt;&lt;P&gt;    ULINE.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 12:48:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928089#M689907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T12:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: need read statment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928090#M689908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You question is very unclear, what do you want to read and where do you want to merge it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, you must check whether the table are standard tables or could be sorted tables, if they are standard tables, then do it that way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort itab1 by ...
loop at itab2

   read itab1 .... binary search

endloop. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;A loop loop at where coding will cause &amp;lt;b&amp;gt;serious performance problems&amp;lt;/b&amp;gt;, same with read without binary search. And only the table with the binary search must be sorted the other one not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If itab1 is sorted table, then loop at where or read with key are o.k.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2007 13:10:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-read-statment/m-p/2928090#M689908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-24T13:10:05Z</dc:date>
    </item>
  </channel>
</rss>

