<?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: itab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712749#M311702</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assume itab1 and itab2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT itab1.
LOOP AT itab1.
  AT END OF lifnr.
    SUM.
    MOVE: itab1-matnr TO itab2-matnr,
          itab1-lifnr TO itab2-lifnr,
          itab1-poqty TO itab2-qty.
    APPEND itab2.
  ENDAT.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Michael Malvey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Nov 2006 18:52:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-17T18:52:21Z</dc:date>
    <item>
      <title>itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712748#M311701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to transfer data from one itab to another.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First Itab:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;MATNR               LIFNR                     EBELN             EBELP          POQTY&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10440                10101               13001            00010         400.00&lt;/P&gt;&lt;P&gt;10440                10101               13001            00020         100.00&lt;/P&gt;&lt;P&gt;10440                10101               13002            00050         125.00&lt;/P&gt;&lt;P&gt;10440                12054               19004            00010          560.00&lt;/P&gt;&lt;P&gt;10440                12054               19005            00010          340.00&lt;/P&gt;&lt;P&gt;16005                10101               21055            00010          545.00&lt;/P&gt;&lt;P&gt;16005                12054               21065            00010          976.00&lt;/P&gt;&lt;P&gt;16005                13560               54102            00010          298.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2nd Itab:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;MATNR              LIFNR              QTY&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10440                10101                  000.00&lt;/P&gt;&lt;P&gt;10440                12054                  000.00&lt;/P&gt;&lt;P&gt;16005                10101                  000.00&lt;/P&gt;&lt;P&gt;16005                12054                  000.00&lt;/P&gt;&lt;P&gt;16005                13560                  000.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have to add the PO's Qty for each "Material" and "Vendor" combination and transfer that total intto the 2nd Itab's Qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody of you please help me in getting the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 18:16:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712748#M311701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T18:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712749#M311702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assume itab1 and itab2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT itab1.
LOOP AT itab1.
  AT END OF lifnr.
    SUM.
    MOVE: itab1-matnr TO itab2-matnr,
          itab1-lifnr TO itab2-lifnr,
          itab1-poqty TO itab2-qty.
    APPEND itab2.
  ENDAT.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Michael Malvey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 18:52:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712749#M311702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T18:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712750#M311703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT itab1.
LOOP AT itab1.
  AT END OF matnr.
  at end of lifnr.
    SUM.
    MOVE: itab1-matnr TO itab2-matnr,
          itab1-lifnr TO itab2-lifnr,
          itab1-poqty TO itab2-qty.
    APPEND itab2.
  ENDAT.
endat.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 18:55:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712750#M311703</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-11-17T18:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712751#M311704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do not need to include both MATNR and LIFNR in separate AT END statements.  Since MATNR is superior, the AT END OF lifnr will process if either MATNR or LIFNR changes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 19:01:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712751#M311704</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T19:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712752#M311705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand you already have 2 tables with the data specified.  In this case you may want  to transfer only the quantity and not the material and vendor.  To add to the above code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_index type sy-tabix.&lt;/P&gt;&lt;P&gt;SORT itab1.&lt;/P&gt;&lt;P&gt;LOOP AT itab1.&lt;/P&gt;&lt;P&gt;  AT END OF lifnr.&lt;/P&gt;&lt;P&gt;    SUM.&lt;/P&gt;&lt;P&gt;    read table itab2 with key matnr = itab1-matnr&lt;/P&gt;&lt;P&gt;                                        lifnr = itab1-lifnr.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      l_index = sy-tabix.&lt;/P&gt;&lt;P&gt;      itab2-qty = itab1-poqty.&lt;/P&gt;&lt;P&gt;      modify itab2 index l_index transporting qty.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  ENDAT.&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;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 19:07:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712752#M311705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T19:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712753#M311706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would just:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT itab1.
  MOVE: itab1-matnr TO itab2-matnr,
        itab1-lifnr TO itab2-lifnr,
        itab1-poqty TO itab2-qty.
  COLLECT itab2.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 19:13:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712753#M311706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T19:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712754#M311707</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;Thanks you very much for the responses. Sorry for getting back to you late.&lt;/P&gt;&lt;P&gt;I was trying all the solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael, Suresh.&lt;/P&gt;&lt;P&gt;As Srinivasa said, there are already records in the Itab2. All I have to add the QTY values to that. If I do APPEND, as suggested by my Itab2 is getting all the records of Itab1 duplicately and I'm getting ******** values for the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivasa,&lt;/P&gt;&lt;P&gt;Thanks again for your response. I followed ur solution. It seemed to worked. &lt;/P&gt;&lt;P&gt;But I can see that is not &amp;lt;b&amp;gt;summing&amp;lt;/b&amp;gt; the POQty values for some reason and it is just passing the &amp;lt;b&amp;gt;value&amp;lt;/b&amp;gt; only to the QTY field in Itab2 not the &amp;lt;b&amp;gt;total&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please tell me what could be the reason for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thnx all for the kind responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 19:42:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712754#M311707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T19:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712755#M311708</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;Please try like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare ITAB3 same as ITAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT ITAB1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1&lt;/P&gt;&lt;P&gt;  MOVE: ITAB1-MATNR TO ITAB3-MATNR,&lt;/P&gt;&lt;P&gt;        ITAB1-LIFNR   TO ITAB3-LIFNR,&lt;/P&gt;&lt;P&gt;        ITAB1-POQTY TO ITAB3QTY.&lt;/P&gt;&lt;P&gt;  COLLECT ITAB3.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB2.&lt;/P&gt;&lt;P&gt;  READ TABLE ITAB3 WITH KEY MATNR = ITAB1-MATNR&lt;/P&gt;&lt;P&gt;                            LIFNR = ITAB1-LIFNR.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    ITAB2-QTY = ITAB3-QTY.&lt;/P&gt;&lt;P&gt;    MODIFY ITAB2.&lt;/P&gt;&lt;P&gt;  ENDIF. &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;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 19:51:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712755#M311708</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-11-17T19:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712756#M311709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ferry,&lt;/P&gt;&lt;P&gt;But we have to SUM up the POQty, right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 20:13:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712756#M311709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T20:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712757#M311710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ferry,&lt;/P&gt;&lt;P&gt;But we have to SUM up the POQty, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 20:14:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712757#M311710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T20:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712758#M311711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The sum statement will sum up all the numeric fields for the given condition.&lt;/P&gt;&lt;P&gt;In your case I only see one reason for displaying only the qty field which is that there should be only one record with the combination of MATNR and LIFNR.  &lt;/P&gt;&lt;P&gt;Also always declare a variable and take the sum into that variable  (this will avoid the sum overflow).  i.e var1 = itab1-poqty will work fine.  Please see that the variable var1 declared is sufficient to hold the sum of all the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 20:14:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712758#M311711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T20:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712759#M311712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The collect statement will do sum of ITAB1-POQTY for unique MATNR and LIFNR combination. Have you tried?&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;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 20:17:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712759#M311712</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-11-17T20:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712760#M311713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you try the code I posted? It's quite simple and should do exactly what you want. The COLLECT handles all the summing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 20:17:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712760#M311713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T20:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712761#M311714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Srinivasa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that 'SUM' function dependent on datatype?&lt;/P&gt;&lt;P&gt;I mean, I have: ITAB1-POQTY like EKET-WEMNG and&lt;/P&gt;&lt;P&gt;                      ITAB2-QTY like MDTB-MNG01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have changed these 2 fields datatypes to see if that works. But it didn't.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 20:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712761#M311714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T20:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712762#M311715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent Rob,&lt;/P&gt;&lt;P&gt;That worked. I'm sorry for not trying that one earlier. You made my day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all.&lt;/P&gt;&lt;P&gt;I really appreciate all your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2006 20:25:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab/m-p/1712762#M311715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-17T20:25:56Z</dc:date>
    </item>
  </channel>
</rss>

