<?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: collect statement not working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443856#M1412699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How you are using COLLECT ?&lt;/P&gt;&lt;P&gt;*Prerequisite for the use of this statement is that wa is compatible with the row type of itab and all components that are not part of the table key must have a numeric data type (i, p, f). *&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Nov 2009 06:35:47 GMT</pubDate>
    <dc:creator>Sandeep_Panghal</dc:creator>
    <dc:date>2009-11-19T06:35:47Z</dc:date>
    <item>
      <title>collect statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443855#M1412698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;           My collect statement is not working. Kindly let me know what is the other way to add one filed in the loop.&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;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message - Please ask a specific question - post locked&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Nov 19, 2009 9:24 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2009 05:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443855#M1412698</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-19T05:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443856#M1412699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How you are using COLLECT ?&lt;/P&gt;&lt;P&gt;*Prerequisite for the use of this statement is that wa is compatible with the row type of itab and all components that are not part of the table key must have a numeric data type (i, p, f). *&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2009 06:35:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443856#M1412699</guid>
      <dc:creator>Sandeep_Panghal</dc:creator>
      <dc:date>2009-11-19T06:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443857#M1412700</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;Take F1 Help on Collect Key word.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Left Hand side of the numeric field value should be identical.&lt;/P&gt;&lt;P&gt;for Ex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab contains vbeln posnr quantity--&amp;gt; in this case collect will not work since same sale order but items change&lt;/P&gt;&lt;P&gt;itab contains vbeln quantity only then it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take temp itab and do it as explained above then converge.&lt;/P&gt;&lt;P&gt;so make your left hand fields uniform and remove other fields then you purpose will be solved&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can use CONTROL BREAK statement like AT NEW and then use key word SUM which sums up all numeric fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more info take F1 help on AT NEW key word&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheerz&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2009 06:42:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443857#M1412700</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-19T06:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443858#M1412701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the COLLECT statement to work, all the fields in the internal table that are not a part of the key should be of numeric type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use control level processing. AT NEW , AT FIRST AT LAST etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This link might help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/EN/9f/db9f1f35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/EN/9f/db9f1f35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2009 06:53:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443858#M1412701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-19T06:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443859#M1412702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same thing i faced few days ago --. i have resolved this using following logic ... try this it will workout&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLEAR: wa_mkpf_mseg, w_werks, w_matnr, w_lgort, w_bwart.
LOOP AT t_mkpf_mseg INTO wa_mkpf_mseg. 
IF wa_mkpf_mseg-werks EQ w_werks AND wa_mkpf_mseg-matnr EQ w_matnr AND wa_mkpf_mseg-lgort EQ w_lgort AND wa_mkpf_mseg-bwart EQ w_bwart.
CLEAR: wa_p_coi.
READ TABLE t_p_coi INTO wa_p_coi WITH KEY werks = wa_mkpf_mseg-werks matnr = wa_mkpf_mseg-matnr lgort = wa_mkpf_mseg-lgort bwart = wa_mkpf_mseg-bwart.
IF sy-subrc = 0.
wa_p_coi-Avg Days = wa_p_coi-Avg Days + wa_mkpf_mseg-Avg Days.
MODIFY t_p_coi FROM wa_p_coi TRANSPORTING Avg Days .
CLEAR: wa_p_coi, wa_p_coi.
endif.
ELSE.
wa_p_coi-werks = wa_mkpf_mseg-werks.
wa_p_coi-matnr = wa_mkpf_mseg-matnr.
wa_p_coi-bwart = wa_mkpf_mseg-bwart.
wa_p_coi-lgort = wa_mkpf_mseg-lgort.
wa_p_coi-Avg Days = wa_mkpf_mseg-Avg Days .
APPEND wa_p_coi TO t_p_coi.
CLEAR: wa_p_coi.
ENDIF.
w_werks = wa_mkpf_mseg-werks.
w_matnr = wa_mkpf_mseg-matnr.
w_lgort = wa_mkpf_mseg-lgort.
w_bwart = wa_mkpf_mseg-bwart.
CLEAR: wa_mkpf_mseg.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2009 12:35:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement-not-working/m-p/6443859#M1412702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-19T12:35:47Z</dc:date>
    </item>
  </channel>
</rss>

