<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897132#M54475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the structure of you internal table.  What are the fields/types.  Maybe post some relevant code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 May 2005 18:10:07 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2005-05-26T18:10:07Z</dc:date>
    <item>
      <title>collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897131#M54474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;lets say I was collecting this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;employee name   deduction   contribution&lt;/P&gt;&lt;P&gt;john doe        500         0 &lt;/P&gt;&lt;P&gt;john doe        0           500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for some reason my program appends this instead of collecting it, any ideas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 18:04:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897131#M54474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T18:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897132#M54475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the structure of you internal table.  What are the fields/types.  Maybe post some relevant code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 18:10:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897132#M54475</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-05-26T18:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897133#M54476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jamie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a collect to work, your fields that need to be added should be of numeric type(P,I or F). They cannot be C or N.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 18:17:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897133#M54476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T18:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897134#M54477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;types:&lt;/P&gt;&lt;P&gt;      begin of data_struc_totals,&lt;/P&gt;&lt;P&gt;        group(12)   type c,              "group&lt;/P&gt;&lt;P&gt;        curr        like t5ud3-curre,&lt;/P&gt;&lt;P&gt;        pen_num     type i,            "number of pensioners&lt;/P&gt;&lt;P&gt;        reg_num     type i,            "number of regulars&lt;/P&gt;&lt;P&gt;        pen_rem     type p decimals 2, "remittance pensioners&lt;/P&gt;&lt;P&gt;        reg_rem     type p decimals 2, "remittance regulars&lt;/P&gt;&lt;P&gt;        pen_cov     type p decimals 2, "coverage pensioners&lt;/P&gt;&lt;P&gt;        reg_cov     type p decimals 2, "coverage regulars&lt;/P&gt;&lt;P&gt;        rem_tot     type p decimals 2,"Grand Total&lt;/P&gt;&lt;P&gt;        cov_tot     type p decimals 2,&lt;/P&gt;&lt;P&gt;        grand_tot   type p decimals 2,&lt;/P&gt;&lt;P&gt;      end of data_struc_totals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the data structure,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 18:33:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897134#M54477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T18:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897135#M54478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok,  I don't see anything wrong with your table structure.  I did a little program and it is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

types:
begin of data_struc_totals,
group(12) type c, "group
curr like t5ud3-curre,
pen_num type i, "number of pensioners
reg_num type i, "number of regulars
pen_rem type p decimals 2, "remittance pensioners
reg_rem type p decimals 2, "remittance regulars
pen_cov type p decimals 2, "coverage pensioners
reg_cov type p decimals 2, "coverage regulars
rem_tot type p decimals 2,"Grand Total
cov_tot type p decimals 2,
grand_tot type p decimals 2,
end of data_struc_totals.

data: itab type table of data_struc_totals with header line.

start-of-selection.



clear itab.
itab-group      = 'A'.
itab-curr       = 'USD'.
itab-pen_num    = '3'.
itab-reg_num    = '2'.
itab-pen_rem    = '5.00'.
collect itab.

clear itab.
itab-group      = 'A'.
itab-curr       = 'USD'.
itab-pen_num    = '1'.
itab-reg_num    = '3'.
itab-pen_rem    = '10.00'.
collect itab.


check sy-subrc  = 0.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code writes one line in the table &lt;/P&gt;&lt;P&gt;A,USD,4,5,15&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post some more of your code showing exactly where you problem is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 18:52:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897135#M54478</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-05-26T18:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897136#M54479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;your just putting collect itab,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm putting collect itab into (results table).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 19:03:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897136#M54479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T19:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897137#M54480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;k, what does your results table look like, and how are you moving the data from one table to the other.  Please post some relevant code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

types:
begin of data_struc_totals,
group(12) type c, "group
curr like t5ud3-curre,
pen_num type i, "number of pensioners
reg_num type i, "number of regulars
pen_rem type p decimals 2, "remittance pensioners
reg_rem type p decimals 2, "remittance regulars
pen_cov type p decimals 2, "coverage pensioners
reg_cov type p decimals 2, "coverage regulars
rem_tot type p decimals 2,"Grand Total
cov_tot type p decimals 2,
grand_tot type p decimals 2,
end of data_struc_totals.

data: itab type table of data_struc_totals with header line.
data: itab2 type table of data_struc_totals with header line.


start-of-selection.

  clear itab.
  itab-group      = 'A'.
  itab-curr       = 'USD'.
  itab-pen_num    = '3'.
  itab-reg_num    = '2'.
  itab-pen_rem    = '5.00'.
  append itab.

  clear itab.
  itab-group      = 'A'.
  itab-curr       = 'USD'.
  itab-pen_num    = '1'.
  itab-reg_num    = '3'.
  itab-pen_rem    = '10.00'.
  append itab.

  check sy-subrc  = 0.


  loop at itab.
    move-corresponding itab to itab2.
    collect itab into itab2.
  endloop.

  check sy-subrc  = 0.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 19:10:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897137#M54480</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-05-26T19:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897138#M54481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: i_results_totals type table of data_struc_totals   with header line.&lt;/P&gt;&lt;P&gt;data: wa_results_totals type data_struc_totals.    "Work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;collect wa_results_totals into i_results_totals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OP 40-44	0	0.00	0.00	111	1,561.81	0.00	1,561.81	0.00	0.00&lt;/P&gt;&lt;P&gt;OP 45-49	0	0.00	0.00	127	3,303.88	60,000.00	3,303.88	60,000.00	0.00&lt;/P&gt;&lt;P&gt;OP 50-54	0	0.00	0.00	119	4,992.77	60,000.00	4,992.77	60,000.00	0.00&lt;/P&gt;&lt;P&gt;OP 50-54	40	3,752.47	42,760,000.00	0	0.00	0.00	3,752.47	42,760,000.00	0.00&lt;/P&gt;&lt;P&gt;OP 55-59	0	0.00	0.00	79	5,690.44	60,000.00	5,690.44	60,000.00	0.00&lt;/P&gt;&lt;P&gt;OP 55-59	167	22,895.74	160,000,000.00	0	0.00	0.00	22,895.74	160,000,000.00	0.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you see how it is not collecting the 55-59 group or the 50-54 group all the time.  It does it for a while then appends another line and uses that one for collecting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 19:28:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897138#M54481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T19:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897139#M54482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a hunch!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check to see if the currencies (CURR) are the same for all the lines. Seems like that is the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rishi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 19:32:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897139#M54482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T19:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897140#M54483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that was a good hunch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a bunch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 19:47:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897140#M54483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T19:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: collect statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897141#M54484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thought that it was understood that anything left of the first numerical field to be collected is the key.....&lt;/P&gt;&lt;P&gt;program will collect by key only, in your case group and currency.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 19:51:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/collect-statement/m-p/897141#M54484</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-05-26T19:51:14Z</dc:date>
    </item>
  </channel>
</rss>

