<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806377#M655862</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP AT i_vbep INTO wa_vbep where MBDAT in s_mbdat.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;  wa_vbep-vbep,&lt;/P&gt;&lt;P&gt;                 wa_vbep-posnr,&lt;/P&gt;&lt;P&gt;                 wa_vbep-etenr,&lt;/P&gt;&lt;P&gt;                 wa_vbep-mbdat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Sep 2007 13:22:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-07T13:22:51Z</dc:date>
    <item>
      <title>AT NEW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806374#M655859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an internal table i_vbep which contains &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;VBEP		POSNR		ETENR		MBDAT
0000000001	000010	 0001		09/06/2007
0000000001	000020	0001		09/06/2007
0000000001	000020	0002		09/07/2007
0000000002	000020	0001		09/06/2007
0000000002	000020	0002		09/08/2007
0000000002	000030	0001		09/06/2007
0000000002	000030	0002		09/10/2007&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need to apply a MBDAT filter s_mbdat to this internal table and delete those rows that dont meet the criteria. If item has only one ETENR i.e. 0001 then apply s_mbdat to the MBDAT. If it has more than one ETENR i.e. 0001, 0002, then apply check for s_mbdat in both the MBDATs. Can someone help me with the code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Megan Flores&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Megan Flores&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 13:19:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806374#M655859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T13:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806375#M655860</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;SEE MY PROGRAM USE IN THIS WAY &lt;/P&gt;&lt;P&gt;I HAD TAKEN ONE EXMPLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Using AT FIRST , AT NEW, AT THE END OF , AT LAST.

DATA: BEGIN OF ITAB OCCURS 0,
      F1 TYPE I,
      F2(6) TYPE C,
      F3(10) TYPE N,
      F4(16) TYPE P DECIMALS  2,

      END OF ITAB.


DATA: SUB_TOT(10) TYPE P DECIMALS 3.

**--1

ITAB-F1 = 1.
ITAB-F2 = 'ONE'.
ITAB-F3 = 10.
ITAB-F4 = '1000.00'.

APPEND ITAB.
CLEAR ITAB.

ITAB-F1 = 1.
ITAB-F2 = 'ONE'.
ITAB-F3 = 20.
ITAB-F4 = '2000.00'.


APPEND ITAB.
CLEAR ITAB.


ITAB-F1 = 1.
ITAB-F2 = 'ONE'.
ITAB-F3 = 30.
ITAB-F4 = '3000.00'.


APPEND ITAB.
CLEAR ITAB.

*--2

ITAB-F1 = 2.
ITAB-F2 = 'TWO'.
ITAB-F3 = 10.
ITAB-F4 = '1000.00'.

APPEND ITAB.
CLEAR ITAB.


ITAB-F1 = 2.
ITAB-F2 = 'TWO'.
ITAB-F3 = 20.
ITAB-F4 = '2000.00'.


APPEND ITAB.
CLEAR ITAB.

*-- 3

ITAB-F1 = 3.
ITAB-F2 = 'THREE'.
ITAB-F3 = 10.
ITAB-F4 = '1000.00'.


APPEND ITAB.
CLEAR ITAB.



ITAB-F1 = 3.
ITAB-F2 = 'THREE'.
ITAB-F3 = 20.
ITAB-F4 = '2000.00'.

APPEND ITAB.
CLEAR ITAB.


SORT ITAB BY F1.

LOOP AT ITAB.

AT FIRST.
WRITE: /35 ' MATERIAL DETAILS:'.
ULINE.
ENDAT.

AT NEW F1.
WRITE: / 'DETAILS OF MATERIAL:' COLOR 7  , ITAB-F1.
ULINE.
ENDAT.

WRITE: / ITAB-F1, ITAB-F2, ITAB-F3, ITAB-F4.

SUB_TOT = SUB_TOT + ITAB-F4.

AT END OF F1.
ULINE.
WRITE: / 'SUB TOTAL :'  COLOR 3 INVERSE ON, SUB_TOT COLOR 3 INVERSE ON.
CLEAR SUB_TOT.
ENDAT.

AT LAST.
SUM.
ULINE.
WRITE: 'SUM:', ITAB-F4.
ULINE.
ENDAT.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD IF USEFULL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 13:21:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806375#M655860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T13:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806376#M655861</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;AT NEW command cannot be Nested... So change the code like this and write ur Logic..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: idx1 TYPE sy-tabix, idx2 TYPE sy-tabix.&lt;/P&gt;&lt;P&gt;  LOOP AT i_vbep INTO wa_vbep.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    MOVE i_vbep  TO i_vbep_temp.&lt;/P&gt;&lt;P&gt;    idx1 = sy-tabix.&lt;/P&gt;&lt;P&gt;    idx2 = sy-tabix.&lt;/P&gt;&lt;P&gt;    WRITE:/ 'IDX1', idx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT NEW vbeln.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      AT NEW etenr.&lt;/P&gt;&lt;P&gt;        WRITE:/ 'IDX2', idx2.&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;&amp;lt;b&amp;gt;reward if helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 13:22:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806376#M655861</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-09-07T13:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806377#M655862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP AT i_vbep INTO wa_vbep where MBDAT in s_mbdat.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;  wa_vbep-vbep,&lt;/P&gt;&lt;P&gt;                 wa_vbep-posnr,&lt;/P&gt;&lt;P&gt;                 wa_vbep-etenr,&lt;/P&gt;&lt;P&gt;                 wa_vbep-mbdat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 13:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806377#M655862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T13:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: AT NEW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806378#M655863</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;go through it and use AT NEW accordingly.&lt;/P&gt;&lt;P&gt;You can use control level statements to react to control breaks in internal tables instead of programming them yourself with logical expressions. Within the loop, you must order the AT-ENDAT statement blocks according to the hierarchy of the control levels. If the internal table has the columns &amp;lt;f1&amp;gt;, &amp;lt;f 2&amp;gt;, ...., and if it is sorted by these columns, you must program the loop as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;  AT FIRST. ... ENDAT.&lt;/P&gt;&lt;P&gt;    AT NEW &amp;lt;f1&amp;gt;. ...... ENDAT.&lt;/P&gt;&lt;P&gt;      AT NEW &amp;lt;f2 &amp;gt;. ...... ENDAT.&lt;/P&gt;&lt;P&gt;        ....... &lt;/P&gt;&lt;P&gt;          &amp;lt;single line processing&amp;gt;&lt;/P&gt;&lt;P&gt;....... &lt;/P&gt;&lt;P&gt;      AT END OF &amp;lt;f2&amp;gt;. ... ENDAT.&lt;/P&gt;&lt;P&gt;    AT END OF &amp;lt;f1&amp;gt;. ... ENDAT.&lt;/P&gt;&lt;P&gt;  AT LAST. .... 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;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2007 13:45:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-new/m-p/2806378#M655863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-07T13:45:53Z</dc:date>
    </item>
  </channel>
</rss>

