<?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: Adding fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024592#M82071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see that you are adding all the different inventories only if the storage location is 0345 or 0340 and type 02 or 04. What happens for all other cases?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Nov 2005 18:50:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-11-14T18:50:05Z</dc:date>
    <item>
      <title>Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024583#M82062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i'm having trouble adding the quantity of fields that have the same MATNR and INVTY...Can anyone help me please!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is my code:&lt;/P&gt;&lt;P&gt;  SELECT MATNR LABST UMLME INSME EINME SPEME RETME LGORT&lt;/P&gt;&lt;P&gt;          INTO TABLE T_MARD FROM MARD&lt;/P&gt;&lt;P&gt;          FOR ALL ENTRIES IN IT_MATNR_TEMP&lt;/P&gt;&lt;P&gt;          WHERE MATNR = IT_MATNR_TEMP-MATNR&lt;/P&gt;&lt;P&gt;          AND WERKS   = '0111'&lt;/P&gt;&lt;P&gt;          AND LGORT IN LS_LGORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT T_MARD.&lt;/P&gt;&lt;P&gt;       IF T_MARD-LGORT = '0345'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IT_MATNR_TEMP-INVTY = '02'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      L_MATNR_QUANT_02 = ( T_MARD-LABST + T_MARD-UMLME + T_MARD-INSME +&lt;/P&gt;&lt;P&gt;                         T_MARD-EINME + T_MARD-SPEME + T_MARD-RETME )&lt;/P&gt;&lt;P&gt;                          + L_MATNR_QUANT_02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MOVE L_MATNR_QUANT_02 TO IT_MATNR_TEMP-QUANT.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING IT_MATNR_TEMP TO IT_MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      APPEND IT_MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSEIF T_MARD-LGORT = '0340'.&lt;/P&gt;&lt;P&gt;      IT_MATNR_TEMP-INVTY = '04'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      L_MATNR_QUANT_04 = ( T_MARD-LABST + T_MARD-UMLME + T_MARD-INSME +&lt;/P&gt;&lt;P&gt;                     T_MARD-EINME + T_MARD-SPEME + T_MARD-RETME )&lt;/P&gt;&lt;P&gt;                     + L_MATNR_QUANT_04.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MOVE L_MATNR_QUANT_04 TO IT_MATNR_TEMP-QUANT.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING IT_MATNR_TEMP TO IT_MATNR.&lt;/P&gt;&lt;P&gt;      APPEND IT_MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:36:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024583#M82062</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024584#M82063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the structure of your internal table IT_MATNR? See if you can use COLLECT statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:42:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024584#M82063</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024585#M82064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this whole code in the loop of IT_MATNR_TEMP?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:43:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024585#M82064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024586#M82065</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;Instead of APPEND use COLLECT to summarize the quantity based on Material and Inventory type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Giridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:44:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024586#M82065</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024587#M82066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i tried it, it doesnt work...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:44:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024587#M82066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024588#M82067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;where would i put COLLECT?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:45:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024588#M82067</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024589#M82068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you give us the whole code starting with the loop of IT_MATNR_TEMP and also the structure of these tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:45:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024589#M82068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024590#M82069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Melissa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I think COLLECT Stmt would do the thing.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   See the follwoing link: &lt;/P&gt;&lt;P&gt; &lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb36d5358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb36d5358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;b&amp;gt; Instead of APPEND stmt, Use COLLECT. &lt;/P&gt;&lt;P&gt;   COLLECT waIT_MATNR into IT_MATNR. &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Allot points for all worthful postings&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:47:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024590#M82069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024591#M82070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you want to add quantities for every matnr and lgort, if so then use COLLECT instead of APPEND. Collect will sum up all the quantities fields so that it will get what you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:47:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024591#M82070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024592#M82071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see that you are adding all the different inventories only if the storage location is 0345 or 0340 and type 02 or 04. What happens for all other cases?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:50:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024592#M82071</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024593#M82072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Melissa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you say the collect is not working, then check how you defined the quantity field in IT_MATNR table. For the collect statement to work the quantity field needs to a numeric data type field not a character data type field. Also make sure that you didn't have any other numeric fields in your internal table IT_MATNR, otherwise they will also get summed up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Giridhar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Giridhar Nayudu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:50:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024593#M82072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024594#M82073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the modified code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT matnr labst umlme insme
       einme speme retme lgort INTO TABLE t_mard
                               FROM mard
                 FOR ALL ENTRIES IN it_matnr_temp
                              WHERE matnr = it_matnr_temp-matnr
                                AND werks = '0111'
                                AND lgort IN ls_lgort.
LOOP AT it_matnr_temp.
  LOOP AT t_mard WHERE matnr = it_matnr_temp-matnr.

    IF t_mard-lgort        = '0345' AND
       it_matnr_temp-invty = '02'.
      CLEAR l_matnr_quant_02.
      l_matnr_quant_02 = t_mard-labst + t_mard-umlme + t_mard-insme +
                         t_mard-einme + t_mard-speme + t_mard-retme.
      MOVE-CORRESPONDING it_matnr_temp TO it_matnr.
      MOVE l_matnr_quant_02 TO it_matnr_temp-quant.

      colelct it_matnr.
      CLEAR it_matnr.
    ELSEIF t_mard-lgort        = '0340' AND
           it_matnr_temp-invty = '04'.
      CLEAR l_matnr_quant_04.
      l_matnr_quant_04 = t_mard-labst + t_mard-umlme + t_mard-insme +
                         t_mard-einme + t_mard-speme + t_mard-retme.
      MOVE-CORRESPONDING it_matnr_temp TO it_matnr.
      MOVE l_matnr_quant_04 TO it_matnr_temp-quant.
      COLLECT it_matnr.
      CLEAR it_matnr.
    ENDIF.
  ENDLOOP.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 18:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-fields/m-p/1024594#M82073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T18:53:28Z</dc:date>
    </item>
  </channel>
</rss>

