<?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: AT NEW statement. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858670#M927471</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;Just copy and paste the below code and check :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types : begin of tp_itab,
        prod type char10,
        qty type i,
        end of tp_itab.

data: ig_itab type standard table of tp_itab,
      wg_itab type tp_itab.

data: ig_out type standard table of tp_itab,
      wg_out type tp_itab.

wg_itab-prod = '101'.
wg_itab-qty  = 10.
append wg_itab to ig_itab.

wg_itab-prod = '101'.
wg_itab-qty  = 20.
append wg_itab to ig_itab.

wg_itab-prod = '103'.
wg_itab-qty  = 20.
append wg_itab to ig_itab.

wg_itab-prod = '103'.
wg_itab-qty  = 20.
append wg_itab to ig_itab.

loop at ig_itab into wg_itab.
collect wg_itab into ig_out.
clear wg_itab.
endloop.

loop at ig_out into wg_out.
write : / wg_out-prod, wg_out-qty.
clear wg_out.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 May 2008 09:41:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-26T09:41:56Z</dc:date>
    <item>
      <title>AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858663#M927464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello all,&lt;/P&gt;&lt;P&gt; my query to get subtotal of all production order &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prod no:  qty&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;101        10&lt;/P&gt;&lt;P&gt;101        20&lt;/P&gt;&lt;P&gt;103        20&lt;/P&gt;&lt;P&gt;103        20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to get &lt;/P&gt;&lt;P&gt;prod no:     qty&lt;/P&gt;&lt;P&gt;101           30&lt;/P&gt;&lt;P&gt;103           40.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i dont want to write the subtotal value just store in itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 08:23:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858663#M927464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T08:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858664#M927465</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;U can use COLLECT statement if u want the total on the basis of production number and if the data is already in internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 08:25:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858664#M927465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T08:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858665#M927466</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;just use At end and store in a new table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of product.&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;move : itab-product to   itab2-product.&lt;/P&gt;&lt;P&gt;          itab-qty       to    itab2-qty.&lt;/P&gt;&lt;P&gt;append itab2.    &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;--&amp;gt;after this itab2 will have the values you need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 08:25:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858665#M927466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T08:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858666#M927467</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;You can do the following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: beign of itab occurs 0,&lt;/P&gt;&lt;P&gt;           prod type char10,&lt;/P&gt;&lt;P&gt;           qty   type i,&lt;/P&gt;&lt;P&gt;        end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_out like itab occurs 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt; collect itab into it_out.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get the sum based on yr production code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 08:27:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858666#M927467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T08:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858667#M927468</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;you can use collect ,check the sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT demo_int_tables_COLLECT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF line,&lt;/P&gt;&lt;P&gt;col1(3) TYPE c,&lt;/P&gt;&lt;P&gt;col2(2) TYPE n,&lt;/P&gt;&lt;P&gt;col3 TYPE i,&lt;/P&gt;&lt;P&gt;END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab LIKE SORTED TABLE OF line&lt;/P&gt;&lt;P&gt;WITH NON-UNIQUE KEY col1 col2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;line-col1 = 'abc'. line-col2 = '12'. line-col3 = 3.&lt;/P&gt;&lt;P&gt;COLLECT line INTO itab.&lt;/P&gt;&lt;P&gt;WRITE / sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;line-col1 = 'def'. line-col2 = '34'. line-col3 = 5.&lt;/P&gt;&lt;P&gt;COLLECT line INTO itab.&lt;/P&gt;&lt;P&gt;WRITE / sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;line-col1 = 'abc'. line-col2 = '12'. line-col3 = 7.&lt;/P&gt;&lt;P&gt;COLLECT line INTO 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 INTO line.&lt;/P&gt;&lt;P&gt;WRITE: / line-col1, line-col2, line-col3.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The list output is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;abc 12 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def 34 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The example fills a sorted table. The first two COLLECT statements work like normal insertion statements. In the third COLLECTstatement, the first line of itab is modified.&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;RAj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 08:31:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858667#M927468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T08:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858668#M927469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in my case prod no is not key field.. and if i code with at new not working with this..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 09:09:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858668#M927469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T09:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858669#M927470</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;You can use collect statement as the production order is of char datatype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 09:14:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858669#M927470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T09:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858670#M927471</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;Just copy and paste the below code and check :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types : begin of tp_itab,
        prod type char10,
        qty type i,
        end of tp_itab.

data: ig_itab type standard table of tp_itab,
      wg_itab type tp_itab.

data: ig_out type standard table of tp_itab,
      wg_out type tp_itab.

wg_itab-prod = '101'.
wg_itab-qty  = 10.
append wg_itab to ig_itab.

wg_itab-prod = '101'.
wg_itab-qty  = 20.
append wg_itab to ig_itab.

wg_itab-prod = '103'.
wg_itab-qty  = 20.
append wg_itab to ig_itab.

wg_itab-prod = '103'.
wg_itab-qty  = 20.
append wg_itab to ig_itab.

loop at ig_itab into wg_itab.
collect wg_itab into ig_out.
clear wg_itab.
endloop.

loop at ig_out into wg_out.
write : / wg_out-prod, wg_out-qty.
clear wg_out.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 09:41:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858670#M927471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T09:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858671#M927472</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;first sort the entries based on prodcution order and use the control break at new to get the subtotal.&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;Bharathi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 09:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858671#M927472</guid>
      <dc:creator>Bharathi_j</dc:creator>
      <dc:date>2008-05-26T09:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW statement.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858672#M927473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gs_p,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i've tried the example with collect it is working fine.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;see the below code&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;           col1(3),&lt;/P&gt;&lt;P&gt;           col2 type i,&lt;/P&gt;&lt;P&gt;       END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-col1 = 101.&lt;/P&gt;&lt;P&gt;itab-col2 = 10.&lt;/P&gt;&lt;P&gt;COLLECT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-col1 = 103.&lt;/P&gt;&lt;P&gt;itab-col2 = 20.&lt;/P&gt;&lt;P&gt;COLLECT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-col1 = 101.&lt;/P&gt;&lt;P&gt;itab-col2 = 30.&lt;/P&gt;&lt;P&gt;COLLECT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-col1 = 103.&lt;/P&gt;&lt;P&gt;itab-col2 = 50.&lt;/P&gt;&lt;P&gt;COLLECT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT itab BY col1.&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;   WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; itab-col1,&lt;/P&gt;&lt;P&gt;                 itab-col2.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz rewards points if helpful,&lt;/P&gt;&lt;P&gt;Ganesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2008 10:11:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-statement/m-p/3858672#M927473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-26T10:11:23Z</dc:date>
    </item>
  </channel>
</rss>

