<?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 Regarding collect in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981002#M950913</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;i have to take these details from tabel bseg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in bseg i have bukrs belnr gjahr buzei shkzg hkont Dmbtr wrbtr from here i have to take data into final o/p tabel.it_final&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in it_final has fields bukrs hkont debitAmt CreditAmt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i need to collect for each gl debit amount and credit amount.&lt;/P&gt;&lt;P&gt;how can i do &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;satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Jun 2008 02:37:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-13T02:37:58Z</dc:date>
    <item>
      <title>Regarding collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981002#M950913</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;i have to take these details from tabel bseg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in bseg i have bukrs belnr gjahr buzei shkzg hkont Dmbtr wrbtr from here i have to take data into final o/p tabel.it_final&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in it_final has fields bukrs hkont debitAmt CreditAmt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i need to collect for each gl debit amount and credit amount.&lt;/P&gt;&lt;P&gt;how can i do &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;satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 02:37:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981002#M950913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T02:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981003#M950914</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;If you want to sum up amounts then use collect statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Susheel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 04:12:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981003#M950914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T04:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981004#M950915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;if shkzg = 'H' it is credit amt , or else it is debit amount ... Move it accordingly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward Points if useful.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raj.D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 04:16:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981004#M950915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T04:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981005#M950916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if the field  shkzg = 'H'  ,then it is a credit amount ,&lt;/P&gt;&lt;P&gt;otherwise it is debit amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so,put a loop at internal table and check the condition shkzg for each loop pass and then move the records to the fields accordingly i.e. credit or debit , and then modify the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after doing these , if you want to add up those field then you can use collect statement for these two fields.&lt;/P&gt;&lt;P&gt;If any iussue you can get back to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 04:47:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981005#M950916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T04:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981006#M950917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Check out the following code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of wa_bseg1,&lt;/P&gt;&lt;P&gt;       bukrs type bukrs,&lt;/P&gt;&lt;P&gt;     hkont type hkont,&lt;/P&gt;&lt;P&gt;     shkzg type shkzg,&lt;/P&gt;&lt;P&gt;     dmbtr type dmbtr,&lt;/P&gt;&lt;P&gt;  end of wa_bseg1,&lt;/P&gt;&lt;P&gt; it_bseg1 like standard table of wa_bseg1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_besg into wa_bseg.&lt;/P&gt;&lt;P&gt;move-corresponding wa_bseg to wa_bseg1.&lt;/P&gt;&lt;P&gt;append wa_bseg1 to it_bseg1.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;sort it_bseg1 by hkont shkzg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bseg1 into wa_bseg1.&lt;/P&gt;&lt;P&gt;wa_final-hkont = wa_bseg1-hkont.&lt;/P&gt;&lt;P&gt;wa_final-bukrs = wa_bseg1-bukrs.&lt;/P&gt;&lt;P&gt;at end of shkzg.&lt;/P&gt;&lt;P&gt;SUM.&lt;/P&gt;&lt;P&gt;if v_prev_hkont ne wa_bseg1-hkont.&lt;/P&gt;&lt;P&gt;if wa_bseg1-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;wa_final-credit_Amt = wa_bseg1-wrbtr.&lt;/P&gt;&lt;P&gt;elseif wa_bseg1-shkzg = 'S'.&lt;/P&gt;&lt;P&gt;wa_final-debit_Amt = wa_bseg1-wrbtr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;append wa_final to it_final.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;if wa_bseg1-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;wa_final-credit_Amt = wa_bseg1-wrbtr.&lt;/P&gt;&lt;P&gt;modify it_final from wa_final where hkont = wa_bseg1-hkont&lt;/P&gt;&lt;P&gt; transporting credit_Amt.&lt;/P&gt;&lt;P&gt;elseif wa_bseg1-shkzg = 'S'.&lt;/P&gt;&lt;P&gt;wa_final-debit_Amt = wa_bseg1-wrbtr.&lt;/P&gt;&lt;P&gt;modify it_final from wa_final where hkont = wa_bseg1-hkont&lt;/P&gt;&lt;P&gt; transporting debit_Amt.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;v_prev_hkont = wa_bseg1-hkont.&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;Regards,&lt;/P&gt;&lt;P&gt;Vigeswaran S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 04:51:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981006#M950917</guid>
      <dc:creator>former_member491305</dc:creator>
      <dc:date>2008-06-13T04:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981007#M950918</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;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   if wa_bsid-shkzg = 'H'.&lt;/P&gt;&lt;P&gt;      wa_data-dmbtr = wa_data-dmbtr * - 1.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    collect wa_data into i_data.&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;Rams&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ramesh on Jun 13, 2008 7:12 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 05:12:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981007#M950918</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T05:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981008#M950919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using COLLECT statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	Syntax&lt;/P&gt;&lt;P&gt;		  COLLECT [&amp;lt;wa&amp;gt; INTO] &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	Note:&lt;/P&gt;&lt;P&gt;Use COLLECT statement for tables having unique standard keys.&lt;/P&gt;&lt;P&gt;Incase of tables with header line omit INTO option.&lt;/P&gt;&lt;P&gt;If an entry with same standard key exists new line is not appended but adds the numeric fields to existing contents.&lt;/P&gt;&lt;P&gt;Else collect acts in a similar way as append.&lt;/P&gt;&lt;P&gt;Sy-tabix contains the index of the processed line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;		     Data: Begin of itab occurs 3,&lt;/P&gt;&lt;P&gt;        		   column1(3) type C,&lt;/P&gt;&lt;P&gt;   			   column2(2) type N,&lt;/P&gt;&lt;P&gt;			   column3 type I,&lt;/P&gt;&lt;P&gt;			End of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;		     itab-column1 = u2018abcu2019.&lt;/P&gt;&lt;P&gt;		     itab-column2 = u201912u2019.&lt;/P&gt;&lt;P&gt;		     itab-column3 = 3.&lt;/P&gt;&lt;P&gt;		     collect itab. &lt;/P&gt;&lt;P&gt;		    write /sy-tabix.	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;		     itab-column1 = u2018defu2019.&lt;/P&gt;&lt;P&gt;		     itab-column2 = u201934u2019.&lt;/P&gt;&lt;P&gt;		     itab-column3 = 5.&lt;/P&gt;&lt;P&gt;		     collect itab. &lt;/P&gt;&lt;P&gt;		    write/sy-tabix.&lt;/P&gt;&lt;P&gt;                                    itab-column1 = u2018abcu2019.&lt;/P&gt;&lt;P&gt;		    itab-column2 = u201912u2019.&lt;/P&gt;&lt;P&gt;		    itab-column3 = 7.&lt;/P&gt;&lt;P&gt;		    collect itab.&lt;/P&gt;&lt;P&gt;		    write /sy-tabix. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;		    Loop at itab.&lt;/P&gt;&lt;P&gt;		        write :/itab-column1,&lt;/P&gt;&lt;P&gt;			    itab-column2,&lt;/P&gt;&lt;P&gt;			    itab-column3.&lt;/P&gt;&lt;P&gt;		    Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	1&lt;/P&gt;&lt;P&gt;	2&lt;/P&gt;&lt;P&gt;	1&lt;/P&gt;&lt;P&gt;	abc	12	10&lt;/P&gt;&lt;P&gt;	def	34	5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 05:16:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981008#M950919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T05:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981009#M950920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Collect statement works on all the numeric and integer fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if your do collect on the internal table type all the number valued fields will get summed up for each unique combination of text/charecter fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the types of the your fields and check collect will suit your requirement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 05:20:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981009#M950920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T05:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding collect</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981010#M950921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi satish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. We have to write like this.&lt;/P&gt;&lt;P&gt;  (some special if condition for debit and credit)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Assuming we have the required data in internal table BSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at   BSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It_final-bukrs = bseg-bukrs.&lt;/P&gt;&lt;P&gt;It_final-hkong = bseg-hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if bseg-SHKZG = 'S'.&lt;/P&gt;&lt;P&gt;it_final-debitAmt = bseg-WRBTR.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if bseg-SHKZG = 'H'.&lt;/P&gt;&lt;P&gt;it_final-creditAmt = bseg-WRBTR.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;COLLECT IT_FINAL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jun 2008 05:48:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-collect/m-p/3981010#M950921</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-13T05:48:40Z</dc:date>
    </item>
  </channel>
</rss>

