<?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 Logic required for a Internal table  issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923626#M1484659</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 2 internal table. I need STLNR value to another internal table. Both having same field. But while reading from one internal table to another internal table using IDNRK key, One idnrk having 2 different stlnr value. But its taking only one. How to take both the values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table value like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_stpo--&amp;gt; This is first table, Here one Idnrk having different stlnr value. I need the same in to next table. Here i read with idnrk field but its taking one stlnr value only into next table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to change the logic ? &lt;/P&gt;&lt;P&gt;Below is it_stpo table and next one is it_mbew_1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;it_stpo&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
STLNR	IDNRK	        MENGE
17224	00439RM1	2.3
17225	00439RM1	4.2
172333	00849RM2	5.6
172158	00432TM3	7.2
152164	00583RM4	8.4
176123	00583RM4	2.3
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;it_mbew_1&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
STLNR	IDNRK	        STPRS
	00439RM1	111.22
	00439RM1	126.45
	00849RM2	3.3364
	00432TM3	15.5888
	00583RM4	0
	00583RM4	0.235
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My logic like below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
          SORT it_stpo BY idnrk.
          SORT it_mbew_1 BY matnr.
          LOOP AT it_mbew_1 INTO wa_mbew_1.
            READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_mbew_1-matnr BINARY SEARCH.
            IF sy-subrc = 0.
              wa_mbew_1-stlnr = wa_stpo-stlnr.
              MODIFY it_mbew_1 FROM wa_mbew_1 TRANSPORTING stlnr WHERE matnr = wa_mbew_1-matnr.
            ENDIF.
          ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mohana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Apr 2010 11:11:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-26T11:11:43Z</dc:date>
    <item>
      <title>Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923626#M1484659</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 2 internal table. I need STLNR value to another internal table. Both having same field. But while reading from one internal table to another internal table using IDNRK key, One idnrk having 2 different stlnr value. But its taking only one. How to take both the values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table value like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_stpo--&amp;gt; This is first table, Here one Idnrk having different stlnr value. I need the same in to next table. Here i read with idnrk field but its taking one stlnr value only into next table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to change the logic ? &lt;/P&gt;&lt;P&gt;Below is it_stpo table and next one is it_mbew_1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;it_stpo&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
STLNR	IDNRK	        MENGE
17224	00439RM1	2.3
17225	00439RM1	4.2
172333	00849RM2	5.6
172158	00432TM3	7.2
152164	00583RM4	8.4
176123	00583RM4	2.3
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;it_mbew_1&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
STLNR	IDNRK	        STPRS
	00439RM1	111.22
	00439RM1	126.45
	00849RM2	3.3364
	00432TM3	15.5888
	00583RM4	0
	00583RM4	0.235
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My logic like below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
          SORT it_stpo BY idnrk.
          SORT it_mbew_1 BY matnr.
          LOOP AT it_mbew_1 INTO wa_mbew_1.
            READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_mbew_1-matnr BINARY SEARCH.
            IF sy-subrc = 0.
              wa_mbew_1-stlnr = wa_stpo-stlnr.
              MODIFY it_mbew_1 FROM wa_mbew_1 TRANSPORTING stlnr WHERE matnr = wa_mbew_1-matnr.
            ENDIF.
          ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mohana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 11:11:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923626#M1484659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T11:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923627#M1484660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
          SORT it_stpo BY idnrk.
          SORT it_mbew_1 BY matnr.
          LOOP AT it_mbew_1 INTO wa_mbew_1.
            LOOP AT it_stpo INTO wa_stpo where idnrk = wa_mbew_1-matnr.
               if sy-tabix &amp;gt; 1.
                  exit.
               else.
              wa_mbew_1-stlnr = wa_stpo-stlnr.
              MODIFY it_mbew_1 FROM wa_mbew_1 TRANSPORTING stlnr WHERE matnr = wa_mbew_1-matnr.
            ENDIF.
          ENDLOOP.
          ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 11:22:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923627#M1484660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T11:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923628#M1484661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try below logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add one more field to it_stpo flag type char01.&lt;/P&gt;&lt;P&gt;update the field with value 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT it_stpo BY idnrk.
          SORT it_mbew_1 BY matnr.
          LOOP AT it_mbew_1 INTO wa_mbew_1.
            CLEAR WA_STPO.
            READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_mbew_1-matnr                                                                                
flag = 'X'.
            if sy-subrc eq 0.
                     move ' ' to wa_stpo-flag.
                     modify it_stpo from wa_stpo index sy-tabix.
                      wa_mbew_1-stlnr = wa_stpo-stlnr.
                     MODIFY it_mbew_1 FROM wa_mbew_1 TRANSPORTING stlnr WHERE matnr = wa_mbew_1-matnr.
             endif.
          ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 11:32:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923628#M1484661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T11:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923629#M1484662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Just try this way.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 SORT it_stpo BY idnrk.
          SORT it_mbew_1 BY matnr.
          LOOP AT it_mbew_1 INTO wa_mbew_1.
            do.
            if sy-index eq 1.
            READ TABLE it_stpo INTO wa_stpo WITH KEY idnrk = wa_mbew_1-matnr BINARY SEARCH .
            w_tabix = sy-tabix.
            else.
            READ TABLE it_stpo  index w_tabix INTO wa_stpo comparing idrnk.
            endif.
            IF sy-subrc = 0.
              wa_mbew_1-stlnr = wa_stpo-stlnr.
              MODIFY it_mbew_1 FROM wa_mbew_1 TRANSPORTING stlnr WHERE matnr = wa_mbew_1-matnr.
            else.
               exit.
            ENDIF.
            endoo.
          ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 11:32:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923629#M1484662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T11:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Logic required for a Internal table  issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923630#M1484663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The relationship between two itabs are not unique, there must be atleast a unique field to relate both.&lt;/P&gt;&lt;P&gt;How did you populate mbew ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Keshav.T on Apr 26, 2010 5:19 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 11:48:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-required-for-a-internal-table-issue/m-p/6923630#M1484663</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-04-26T11:48:32Z</dc:date>
    </item>
  </channel>
</rss>

