<?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 command not working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928292#M689963</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;Declare the LIFNR as the first field in your internal table...The field position matters when you use AT NEW..AT END OF..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because if you use AT NEW lifnr...The fields that are defined leftmost to that field will also be considered..Meaning if there is change in the value then AT NEW triggers..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have two options..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Change the declaration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : Begin of itab,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;LIFNR like RBKP-LIFNR, " Vendor Code&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;BELNR like RBKP-BELNR, " Invoice Document Number&lt;/P&gt;&lt;P&gt;BUZEI like RSEG-BUZEI, " Invoice Item Number&lt;/P&gt;&lt;P&gt;GJAHR like RBKP-GJAHR, " Fiscal Year&lt;/P&gt;&lt;P&gt;EBELN like RSEG-EBELN, " Purchase Order Number&lt;/P&gt;&lt;P&gt;MENGE like RSEG-MENGE, " Invoice Quantity&lt;/P&gt;&lt;P&gt;RMWWR like RBKP-RMWWR, " Invoice Amount&lt;/P&gt;&lt;P&gt;WAERS like RBKP-WAERS, " Currency&lt;/P&gt;&lt;P&gt;MATNR like RSEG-MATNR, " Material Number&lt;/P&gt;&lt;P&gt;ZTERM like RBKP-ZTERM, " Terms of payment key&lt;/P&gt;&lt;P&gt;End of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Instead of AT NEW..use ON CHANGE OF ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move itab2 to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ON CHANGE OF  itab2-LIFNR.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / itab-lifnr.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ENDON.&amp;lt;/b&amp;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;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Oct 2007 04:01:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-12T04:01:51Z</dc:date>
    <item>
      <title>At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928288#M689959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I pasted my sample code below. In this i have used "At new event" this command is not working in my code, the values are redundant, How to rectify this problem. Pls help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables : RBKP,&lt;/P&gt;&lt;P&gt;         RSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : Begin of itab,&lt;/P&gt;&lt;P&gt;       BELNR like RBKP-BELNR, " Invoice Document Number&lt;/P&gt;&lt;P&gt;       BUZEI like RSEG-BUZEI, " Invoice Item Number&lt;/P&gt;&lt;P&gt;       GJAHR like RBKP-GJAHR, " Fiscal Year&lt;/P&gt;&lt;P&gt;       EBELN like RSEG-EBELN, " Purchase Order Number&lt;/P&gt;&lt;P&gt;       MENGE like RSEG-MENGE, " Invoice Quantity&lt;/P&gt;&lt;P&gt;       RMWWR like RBKP-RMWWR, " Invoice Amount&lt;/P&gt;&lt;P&gt;       WAERS like RBKP-WAERS, " Currency&lt;/P&gt;&lt;P&gt;       MATNR like RSEG-MATNR, " Material Number&lt;/P&gt;&lt;P&gt;       LIFNR like RBKP-LIFNR, " Vendor Code&lt;/P&gt;&lt;P&gt;       ZTERM like RBKP-ZTERM, " Terms of payment key&lt;/P&gt;&lt;P&gt;       End of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data itab2 like itab occurs 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a like rbkp-lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selection-screen  : Begin of block a with frame title text-001.&lt;/P&gt;&lt;P&gt;Select-options    : LIF For RBKP-LIFNR.&lt;/P&gt;&lt;P&gt;Select-options    : gjahr For RBKP-gjahr.&lt;/P&gt;&lt;P&gt;Selection-screen  : End of block a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start-of-selection.&lt;/P&gt;&lt;P&gt;select * from rbkp where LIFNR in LIF and GJAHR in gjahr.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    select * from rseg where BELNR = rbkp-BELNR and gjahr = rbkp-gjahr.&lt;/P&gt;&lt;P&gt;      if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        itab-BELNR = RBKP-BELNR.&lt;/P&gt;&lt;P&gt;        itab-BUZEI = RSEG-BUZEI.&lt;/P&gt;&lt;P&gt;        itab-GJAHR = RBKP-GJAHR.&lt;/P&gt;&lt;P&gt;        itab-EBELN = RSEG-EBELN.&lt;/P&gt;&lt;P&gt;        itab-MENGE = RSEG-MENGE.&lt;/P&gt;&lt;P&gt;        itab-RMWWR = RBKP-RMWWR.&lt;/P&gt;&lt;P&gt;        itab-WAERS = RBKP-WAERS.&lt;/P&gt;&lt;P&gt;        itab-MATNR = RSEG-MATNR.&lt;/P&gt;&lt;P&gt;        itab-LIFNR = RBKP-LIFNR.&lt;/P&gt;&lt;P&gt;        append itab to itab2.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endselect.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort itab2 by LIFNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move itab2 to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at new LIFNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / itab-lifnr.&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kesav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 14:53:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928288#M689959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-11T14:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928289#M689960</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;Make lifnr as first field in the internal table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Navneet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 15:01:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928289#M689960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-11T15:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928290#M689961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Your select query seems to be wrong. try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from rbkp into itab1&lt;/P&gt;&lt;P&gt; where LIFNR in LIF and GJAHR in gjahr.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;select * from rseg &lt;/P&gt;&lt;P&gt;into itab2 for all entries in itab1&lt;/P&gt;&lt;P&gt;where BELNR = itab1-BELNR and gjahr = itab1.-gjahr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 15:03:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928290#M689961</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-11T15:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928291#M689962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kesava,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key field in RBKP table is BELNR. So while sorting sort with this also. Chk fro the changes in your code ( block letters)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables : RBKP,&lt;/P&gt;&lt;P&gt;RSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : Begin of itab,&lt;/P&gt;&lt;P&gt;BELNR like RBKP-BELNR, " Invoice Document Number&lt;/P&gt;&lt;P&gt;BUZEI like RSEG-BUZEI, " Invoice Item Number&lt;/P&gt;&lt;P&gt;GJAHR like RBKP-GJAHR, " Fiscal Year&lt;/P&gt;&lt;P&gt;EBELN like RSEG-EBELN, " Purchase Order Number&lt;/P&gt;&lt;P&gt;MENGE like RSEG-MENGE, " Invoice Quantity&lt;/P&gt;&lt;P&gt;RMWWR like RBKP-RMWWR, " Invoice Amount&lt;/P&gt;&lt;P&gt;WAERS like RBKP-WAERS, " Currency&lt;/P&gt;&lt;P&gt;MATNR like RSEG-MATNR, " Material Number&lt;/P&gt;&lt;P&gt;LIFNR like RBKP-LIFNR, " Vendor Code&lt;/P&gt;&lt;P&gt;ZTERM like RBKP-ZTERM, " Terms of payment key&lt;/P&gt;&lt;P&gt;End of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data itab2 like itab occurs 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a like rbkp-lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selection-screen : Begin of block a with frame title text-001.&lt;/P&gt;&lt;P&gt;Select-options : LIF For RBKP-LIFNR.&lt;/P&gt;&lt;P&gt;Select-options : gjahr For RBKP-gjahr.&lt;/P&gt;&lt;P&gt;Selection-screen : End of block a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start-of-selection.&lt;/P&gt;&lt;P&gt;select * from rbkp where LIFNR in LIF and GJAHR in gjahr.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;select * from rseg where BELNR = rbkp-BELNR and gjahr = rbkp-gjahr.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;itab-BELNR = RBKP-BELNR.&lt;/P&gt;&lt;P&gt;itab-BUZEI = RSEG-BUZEI.&lt;/P&gt;&lt;P&gt;itab-GJAHR = RBKP-GJAHR.&lt;/P&gt;&lt;P&gt;itab-EBELN = RSEG-EBELN.&lt;/P&gt;&lt;P&gt;itab-MENGE = RSEG-MENGE.&lt;/P&gt;&lt;P&gt;itab-RMWWR = RBKP-RMWWR.&lt;/P&gt;&lt;P&gt;itab-WAERS = RBKP-WAERS.&lt;/P&gt;&lt;P&gt;itab-MATNR = RSEG-MATNR.&lt;/P&gt;&lt;P&gt;itab-LIFNR = RBKP-LIFNR.&lt;/P&gt;&lt;P&gt;append itab to itab2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Sort itab2 by belnr LIFNR.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move itab2 to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at new LIFNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / itab-lifnr.&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;Reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chitra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 03:45:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928291#M689962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T03:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928292#M689963</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;Declare the LIFNR as the first field in your internal table...The field position matters when you use AT NEW..AT END OF..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because if you use AT NEW lifnr...The fields that are defined leftmost to that field will also be considered..Meaning if there is change in the value then AT NEW triggers..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have two options..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Change the declaration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : Begin of itab,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;LIFNR like RBKP-LIFNR, " Vendor Code&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;BELNR like RBKP-BELNR, " Invoice Document Number&lt;/P&gt;&lt;P&gt;BUZEI like RSEG-BUZEI, " Invoice Item Number&lt;/P&gt;&lt;P&gt;GJAHR like RBKP-GJAHR, " Fiscal Year&lt;/P&gt;&lt;P&gt;EBELN like RSEG-EBELN, " Purchase Order Number&lt;/P&gt;&lt;P&gt;MENGE like RSEG-MENGE, " Invoice Quantity&lt;/P&gt;&lt;P&gt;RMWWR like RBKP-RMWWR, " Invoice Amount&lt;/P&gt;&lt;P&gt;WAERS like RBKP-WAERS, " Currency&lt;/P&gt;&lt;P&gt;MATNR like RSEG-MATNR, " Material Number&lt;/P&gt;&lt;P&gt;ZTERM like RBKP-ZTERM, " Terms of payment key&lt;/P&gt;&lt;P&gt;End of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Instead of AT NEW..use ON CHANGE OF ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move itab2 to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ON CHANGE OF  itab2-LIFNR.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write : / itab-lifnr.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ENDON.&amp;lt;/b&amp;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;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 04:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928292#M689963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T04:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928293#M689964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have placed the AT NEW  statement in a wrong place plz debug the report ,and checked it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 04:06:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928293#M689964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T04:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928294#M689965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kesava...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the code like this .. it will work..&lt;/P&gt;&lt;P&gt;Note: &lt;/P&gt;&lt;P&gt;1.Use joins instead of Nested SELECTs which gives the Worst performance.&lt;/P&gt;&lt;P&gt;2. You can use ON CHANGE OF &amp;lt;field&amp;gt; since the LIFNR is not the first field in ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables : RBKP,&lt;/P&gt;&lt;P&gt;RSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : Begin of itab,&lt;/P&gt;&lt;P&gt;BELNR like RBKP-BELNR, " Invoice Document Number&lt;/P&gt;&lt;P&gt;BUZEI like RSEG-BUZEI, " Invoice Item Number&lt;/P&gt;&lt;P&gt;GJAHR like RBKP-GJAHR, " Fiscal Year&lt;/P&gt;&lt;P&gt;RMWWR like RBKP-RMWWR, " Invoice Amount&lt;/P&gt;&lt;P&gt;WAERS like RBKP-WAERS, " Currency&lt;/P&gt;&lt;P&gt;LIFNR like RBKP-LIFNR, " Vendor Code&lt;/P&gt;&lt;P&gt;ZTERM like RBKP-ZTERM, " Terms of payment key&lt;/P&gt;&lt;P&gt;EBELN like RSEG-EBELN, " Purchase Order Number&lt;/P&gt;&lt;P&gt;MATNR like RSEG-MATNR, " Material Number&lt;/P&gt;&lt;P&gt;MENGE like RSEG-MENGE, " Invoice Quantity&lt;/P&gt;&lt;P&gt;End of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data itab2 like itab occurs 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a like rbkp-lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selection-screen : Begin of block a with frame title text-001.&lt;/P&gt;&lt;P&gt;Select-options : LIF For RBKP-LIFNR.&lt;/P&gt;&lt;P&gt;Select-options : gjahr For RBKP-gjahr.&lt;/P&gt;&lt;P&gt;Selection-screen : End of block a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT  RBKP&lt;SUB&gt;BELNR  RBKP&lt;/SUB&gt;GJAHR RBKP&lt;SUB&gt;BUZEI RBKP&lt;/SUB&gt;RMWWR.&lt;/P&gt;&lt;P&gt;              RBKP&lt;SUB&gt;WAERS RBKP&lt;/SUB&gt;LIFNR RBKP~ZTERM&lt;/P&gt;&lt;P&gt;              RSEG&lt;SUB&gt;EBELN   RSEG&lt;/SUB&gt;MATNR RSEG~MENGE&lt;/P&gt;&lt;P&gt;FROM RBKP &lt;/P&gt;&lt;P&gt;INNER JOIN RSEG&lt;/P&gt;&lt;P&gt;ON   RBKP&lt;SUB&gt;BELNR  = RSEG&lt;/SUB&gt;BELNR &lt;/P&gt;&lt;P&gt; AND RBKP&lt;SUB&gt;GJAHR = RSEG&lt;/SUB&gt;GJAHR&lt;/P&gt;&lt;P&gt; AND RBKP&lt;SUB&gt;BUZEI = RSEG&lt;/SUB&gt;BUZEI &lt;/P&gt;&lt;P&gt;INTO TABLE ITAB2 &lt;/P&gt;&lt;P&gt;WHERE RBKP&lt;SUB&gt;LIFNR IN LIF AND RBKP&lt;/SUB&gt;GJAHR IN GJAHR.&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;Sort itab2 by LIFNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move itab2 to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on change of itab-LIFNR.&lt;/P&gt;&lt;P&gt;write : / itab-lifnr.&lt;/P&gt;&lt;P&gt;endat.&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;REWARD IF HELPFUL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 04:21:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928294#M689965</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-10-12T04:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928295#M689966</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 am sending a sample code where that events worked &lt;/P&gt;&lt;P&gt;you can understand very easily &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZDAN108.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Using AT FIRST , AT NEW, AT THE END OF , AT LAST.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;      F1 TYPE I,&lt;/P&gt;&lt;P&gt;      F2(6) TYPE C,&lt;/P&gt;&lt;P&gt;      F3(10) TYPE N,&lt;/P&gt;&lt;P&gt;      F4(16) TYPE P DECIMALS  2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      END OF ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: SUB_TOT(10) TYPE P DECIMALS 3.&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;ITAB-F1 = 1.&lt;/P&gt;&lt;P&gt;ITAB-F2 = 'ONE'.&lt;/P&gt;&lt;P&gt;ITAB-F3 = 10.&lt;/P&gt;&lt;P&gt;ITAB-F4 = '1000.00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB-F1 = 1.&lt;/P&gt;&lt;P&gt;ITAB-F2 = 'ONE'.&lt;/P&gt;&lt;P&gt;ITAB-F3 = 20.&lt;/P&gt;&lt;P&gt;ITAB-F4 = '2000.00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ITAB.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&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AT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LAST.&lt;/P&gt;&lt;P&gt;SUM.&lt;/P&gt;&lt;P&gt;ULINE.&lt;/P&gt;&lt;P&gt;WRITE: 'SUM:', ITAB-F4.&lt;/P&gt;&lt;P&gt;ULINE.&lt;/P&gt;&lt;P&gt;ENDAT.&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;&amp;lt;b&amp;gt;Reward if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 04:44:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928295#M689966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T04:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928296#M689967</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;change the code like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : Begin of itab,&lt;/P&gt;&lt;P&gt;LIFNR like RBKP-LIFNR, " Vendor Code&lt;/P&gt;&lt;P&gt;BELNR like RBKP-BELNR, " Invoice Document Number&lt;/P&gt;&lt;P&gt;BUZEI like RSEG-BUZEI, " Invoice Item Number&lt;/P&gt;&lt;P&gt;GJAHR like RBKP-GJAHR, " Fiscal Year&lt;/P&gt;&lt;P&gt;EBELN like RSEG-EBELN, " Purchase Order Number&lt;/P&gt;&lt;P&gt;MENGE like RSEG-MENGE, " Invoice Quantity&lt;/P&gt;&lt;P&gt;RMWWR like RBKP-RMWWR, " Invoice Amount&lt;/P&gt;&lt;P&gt;WAERS like RBKP-WAERS, " Currency&lt;/P&gt;&lt;P&gt;MATNR like RSEG-MATNR, " Material Number&lt;/P&gt;&lt;P&gt;ZTERM like RBKP-ZTERM, " Terms of payment key&lt;/P&gt;&lt;P&gt;End of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Prajith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 05:51:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928296#M689967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T05:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: At new command not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928297#M689968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;after  every control break statement u have read table statement with sy-index ......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its actually a bug in sap..................u can find this in OSS  also......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 05:57:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new-command-not-working/m-p/2928297#M689968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T05:57:40Z</dc:date>
    </item>
  </channel>
</rss>

