DIFFERENCE BETWEEN "AT NEW " AND "AT FIRST" , "AT END OF" AND "AT LAST" ?

WHAT IS THE DIFFERENCE BETWEEN "AT NEW " AND "AT FIRST" , "AT END OF" AND "AT LAST" WITH REFERENCE TO CONTROL BREAK STATEMENTS ? PLEASE EXPLAIN IN DETAIL.
BEST REGARDS
RYAN.

Hi
i am sending you a simple program in which i had write program on that events
you can understand very easily
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.
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.
<b>Reward if usefull</b>

Similar Messages

  • Difference between At-new and on change of

    Hi,
    Can anyone send me the exact difference between At-new and On change of
    Thank You
    Santosh

    Hi anjali,
    I just entered your subject "difference between At-new and on change of" as search terms in the SEARCH FORUM input field.
    Please check the results and come back after.
    Difference between At new and On change of?
    Posted on: 28.09.2006 19:01, by user: subhash soni -- Relevance: 100% -- Show all results within this thread
    Hi What is the difference between At new and On change of? Thank You
    difference between At-new and on change of
    Posted on: 09.03.2007 20:16, by user: anjali nalluri -- Relevance: 89% -- Show all results within this thread
    Hi, Can anyone send me the exact difference between At-new and On change of Thank You Santosh
    Diff between AT new and on change of
    Posted on: 30.11.2006 16:06, by user: Pavan Ravikanti -- Relevance: 53% -- Show all results within this thread
    hi, can any one tell me what is the exact difference between <b>AT new</b> and <b>on change of</b> thanks pavan ...
    Diff. between At New and On Change Of
    Posted on: 05.10.2005 08:58, by user: surya mamtha -- Relevance: 48% -- Show all results within this thread
    Hi, Could anybody exlain the difference between At New event and On Change Of event in detail? And how can we avoid the inner loops ...
    Major Diff. Between On change of and At New
    Posted on: 24.05.2006 12:48, by user: IFF -- Relevance: 46% -- Show all results within this thread
    Hi Experts, Could you please let me know that what is the major difference between the control break statements On change of and At new. Which one is best to used ...
    diff between at new and on change of
    Posted on: 08.03.2007 16:27, by user: saroja ponnam -- Relevance: 44% -- Show all results within this thread
    Hi all, what is the main diff between at new and on change of statements. Regards Saroja.
    Differnce between AT NEW AND ON CHANGE OF
    Posted on: 06.05.2006 10:55, by user: Raja Sekhar T -- Relevance: 44% -- Show all results within this thread
    Hi, Differnce between AT NEW AND ON CHANGE OF Iam waiting foryour reply Thanks & Regards Raja Sekhar.T ...
    Regards,
    Clemens

  • Difference between At new and on change statement?

    What is the difference between at new and on change statement? Please explain with an example.

    hi
    on change of differs from at new in the following respects:
    It can be used in any loop construct, not just loop at. For example, it can be used within select and endselect, do and enddo, or while and endwhile, as well as inside get events.
    A single on change of can be triggered by a change within one or more fields named after of and separated by or. These fields can be elementary fields or field strings. If you are within a loop, these fields do not have to belong to the loop.
    When used within a loop, a change in a field to the left of the control level does not trigger a control break.
    When used within a loop, fields to the right still contain their original values; they are not changed to contain zeros or asterisks.
    You can use else between on change of and endon.
    You can use it with loop at it where . . ..
    You can use sum with on change of. It sums all numeric fields except the one(s) named after of.
    Any values changed within on change of remain changed after endon. The contents of the header line are not restored as they are for at and endat.
    REGARDS
    PRASANTH

  • Difference  between AT NEW and ON CHANGE

    difference  between AT NEW and ON CHANGE

    HI,
    at new is controlbreak statment and on change of is not and we can use onchange of  out side the loop
    and on at nnwe the left side feild change  the event
    trigers and the values become 0 and *
    -->1.It can be used in any loop construct, not just loop at.
    For example, it can be used within select and endselect, do
    and enddo, or while and endwhile, as well as inside get events.
    2. A single on change of can be triggered by a change within
    one or more fields named after of and separated by or. These
    fields can be elementary fields or field strings. If you are
    within a loop, these fields do not have to belong to the loop.
    3.When used within a loop, a change in a field to the left
    of the control level does not trigger a control break.
    4.When used within a loop, fields to the right still contain
    their original values; they are not changed to contain zeros
    or asterisks.
    5.You can use else between on change of and endon.
    6.You can use it with loop at it where . . ..
    7. You can use sum with on change of. It sums all numeric
    fields except the one(s) named after of.
    8.Any values changed within on change of remain changed
    after endon. The contents of the header line are not
    restored as they are for at and endat
    regards,
    vineela.

  • Difference between the new and old airport express

    Have an airport express bought in the summer of 2004. It extends my home network and have never had any trouble with it. (Still using system x3.9 ). Everything is stable. Calm. If I were to buy a new airport express today, do I understand right that it would not work with my current system? What's the difference between the newer airport express and the one I have?

    I don't think there's much of a difference between the old Express and the new one. The only difference for sure, will probably be the Airport software, which is at its current version (I forget which). I too, bought my Airport Express when it first came out and I'm running software 6.1.1 on it, I think the newest is at 6.4 now or something like that.
    Only reason why it wouldn't work with your system is most like due to the updated software. The tech specs doesn't really say 10.4 or higher is required, but it looks like it's suggested to use the features such as USB printing, etc. http://www.apple.com/airportexpress/specs.html

  • Difference between "All New" and "All Unplayed"? [podcast section]

    What's the difference between these two settings under the podcast section?
    I have no idea, they seem like they would be the same?

    Right. Suppose you have 5 podcasts on a given subscription. You've listened to the most recent one.
    3 newest would be the three newest, including the one you've listened to.
    3 most recent unplayed would be the second, third, and fourth ones - not the oldest one (because you're only getting three), but not the newest one, because that one has already been played.

  • What is the difference between the new and old 30gigs

    i have an old what is the other differences other than the search function like how much longer does the battery last?

    These Specification comparisons might help with the difference between these two models:
    Fifth Generation iPod - Technical Specifications
    Fifth Generation iPod (Late 2006) - Technical Specifications
    -Kylene

  • What is the difference between the new and old ipad mini case?

    I was wondering what the difference is between the old ipad mini case and the new one which came out with the ipad mini with retina display?

    I just bought an iPad Mini case for my iPad Mini with Retina Display, and it DOES NOT FIT...  This particular case has a hard plastic cradle for the iPad to fit into and it does not wrap around the edges enough to hold it in...  I am shocked at how snug these cases will fit, even though there is only a 0.01" difference in thickness...  So again, I repeat, an iPad Mini with Retina Display WILL NOT FIT into the first gen iPad Mini case!

  • Difference between AT NEW ..... and ON CHANGE events

    difference between AT NEW and ON Change events..
    Thanks

    Hi
    <b>AT NEW</b>
    |{END OF} comp
    Beginning or end of a group of lines with the same content in the component comp1 comp2 ... and in the components to the left of comp1 comp2 .... The components comp1 comp2 ... can be specified, as described in the section Specification of Components, with the limitation that access to object attributes is not possible here.
    <b>ON CHANGE OF</b>
    ON CHANGE OF dobj [OR dobj1 [OR dobj2] ... ].
      statement_block
    ENDON.
    The statements ON CHANGE OF and ENDON, which are forbidden in classes, define a control structure that can contain a statement block statement_block. After ON CHANGE OF, any number of data objects dobj1, dobj2... of any data type can be added, linked by OR.
    The first time a statement ON CHANGE OF is executed, the statement block is executed if at least one of the specified data objects is not initial. The statement block is executed for each additional execution of the same statement ON CHANGE OF, if the content of one of the specified data objects has been changed since the last time the statement ON CHANGE OF was executed.
    For each time the statement ON CHANGE OF is executed, the content of all the specified data objects is saved as an auxiliary variable internally in the global system. The auxiliary variable is linked to this statement and cannot be accessed in the program. The auxiliary variables and their contents are retained longer than the lifetime of procedures. An auxiliary variable of this type can only be initialized if its statement ON CHANGE OF is executed while the associated data object is initial.
    This control structure, which is forbidden in classes, is particularly prone to errors and should be replaced by branches with explicitly declared auxiliary variables.
    <b>example:-</b>
    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.

  • Difference btwn at new and on change of

    Hi all,
    can i know the difference between 'at new' and 'on change of'.

    Hi,
    at new - > means inside the loop, the new value.
    eg :
    1
    1
    2
    3
    4
    5
    5
    loop at itab
    at new matnr
    write matnr.
    end at.
    end loop.
    1
    2
    3
    4
    5
    On change of -> chnage of particular value inside the loop.
    The Major Difference is :
    a) When AT NEW occurs,
    the alpha-numeric fields have ******* in their value,
    b) where as in case of ON CHANGE,
    the alpha-numeric fields have their corresponding value,
    of that particular record,
    where the Event gets fired.
    Other differences are :
    ON CHANGE OF can be used any where in the program..
    on change of differs from at new in the following respects:
    1.It can be used in any loop construct, not just loop at. For example, it can be used within select and endselect, do and enddo, or while and endwhile, as well as inside get events.
    2.A single on change of can be triggered by a change within one or more fields named after of and separated by or. These fields can be elementary fields or field strings. If you are within a loop, these fields do not have to belong to the loop.
    3.When used within a loop, a change in a field to the left of the control level does not trigger a control break.
    4.When used within a loop, fields to the right still contain their original values; they are not changed to contain zeros or asterisks.
    5.You can use else between on change of and endon.
    6.You can use it with loop at it where . . ..
    7.You can use sum with on change of. It sums all numeric fields except the one(s) named after of.
    8.Any values changed within on change of remain changed after endon. The contents of the header line are not restored as they are for at and endat.
    while
    AT NEW can be used only within a loop of an INTERNAL TABLE..
    5. Sample program to get the taste of it
    (just copy paste)
    6.
    REPORT ABC.
    DATA : BEGIN OF ITAB OCCURS 0,
    bukrs like t001-bukrs,
    f1(10) type c,
    end of itab.
    itab-bukrs = '1000'.
    itab-f1 = '1111111'.
    append itab.
    itab-bukrs = '1100'.
    itab-f1 = '3333333'.
    append itab.
    itab-bukrs = '1200'.
    itab-f1 = '555555'.
    append itab.
    AT NEW
    loop at itab.
    at new bukrs.
    write :/ itab-bukrs , itab-f1.
    endat.
    endloop.
    AT ONCHANGE
    loop at itab.
    ON CHANGE OF ITAB-BUKRS.
    write :/ itab-bukrs , itab-f1.
    ENDON.
    Regards,
    Ferry Lianto

  • Difference between 'Add new & align' vs duplicate & align

    Can someone pls enlighten me : need to understand the difference between 'Add new and Align' and 'Duplicate and Align' while cascading objectives in Oracle Performance Management / Talent Management.
    Edited by: 906584 on Jan 7, 2012 12:22 PM

    "Add new and align button" to create a new supporting objective "‘Objective Name : You can Rename for Worker".
    This objective is cascaded to both workers and Manager.
    "Duplicate and Align’ button" : An exact duplicate of the topmost manager’s objective is created and cascaded to the worker.
    Thanks, Avaneesh

  • What are the differences between ECC5.0 and 6.0 new GL functionality

    Hi Experts,
    What are the differences between ECC5.0 and 6.0 new GL functionality.
    If we want to implement IFRS, I think New GL functionality is very helpful, but why sap is recommending only for ECC6.0 new GL functionality, Eventhough this functionality is available in ECC5.0.
    Best Regards,
    Dharani

    Dear,
    ECC 5.0 vs. ECC 6.0/SAP ERP 6.0
    Functionality not available in the new G/L with mySAP ERP 2004 and ERP Central Component (ECC) 5.0:
    Transfer prices
    Statistical key figures
    Euro translation
    Audit Information System (AIS)
    Archiving
    Data retention tool
    Regards,
    Chintan Joshi.

  • I do video productions for a small local TV station. I use Final Cut Express to edit. I need a new video camera but am at a loss as to what to buy. I know I will get a digital camera but do not know the difference between just digital and digital HD.

    I do video productions for a small local TV station. I use Final Cut Express to edit. I need a new video camera but am at a loss as to what to buy. I know I will get a digital camera but do not know the difference between just digital and digital HD. Also, I can not afford an expensive camera and need some advice on which of the available cameras would be best and also work well with a Mac. One last issue, I currently use a Panasonic #CCD camera that takes a tape. When I load video to Final Cut the audio and video are out of sinc. Go figure. Can anyone help with these questions. Karen

    Hello Karen,
    If you are using Final Cut Express, then look for camcorders that are AVCHD camcorders.  Look especially for the AVCHD logo and specific mention of AVCHD in the specs.  Most of the major manufacturers produce good quality camdcorders - Canon, Sony, etc.
    Also, be aware that there are a lot of "not quite AVCHD" camcorders on the market (sometimes they say they record video as MPEG4-H.264/AVC) - buyer beware!
    Most everything you are going to find on the market today is HD, which stands for "high-def".
    Regarding your question about the Panasonic camcorder, it's best if you post that as a separate question, and please identify the specific model camcorder and the Easy Setup you are using in FCE.

  • How can I tell the differences between the new MacBook Pro with retina display and the old MacBook Pro with retina display by looking

    I'm just wondering the differences between the new MacBook Pro with retina display which was just released in October 2013 and the old MacBook Pro with retina display.

    Thank you for the reply! As you said they looked exactly the same, so I'm not able to tell the differences just by looking, right? I'm thinking to buy a new 13-inch MacBook Pro with retina display, but I'm not buying the MacBook in Apple Store, I'm buying it in other shops, how can know whether they are not selling me the old model of MacBook Pro with retina display?

  • Difference between Special GL and New GL

    Dear SAP Gurus,
                            What is the difference between Special GL and New GL?
    Thanks & Regards,
    Sim

    Dear Sim
    If I understood logically, then your question actually refer to special purpose ledger, right ?
    If so both are almost same. Both are for you to depict parallel accounting in your SAP system by storing posting data for the various accounting principles in separate ledgers.
    Whereas special purpose ledger is more custome developed (data is stored in 'Z' table), whereas New GL is more standardised from SAP as well as advanced when compared to special purpose ledger.
    Hope I understood correctly your question and gave some useful input.
    Regards
    Siva

Maybe you are looking for