What is the perfect defference between AT NEW and ON CHANGE...

What is the perfect defference between AT NEW and ON CHANGE...?

hi vijay,
if u use 'at-new' statement , basically it dont pick first record of the itab where as 'on chage of' can pick from first record.
all these control brake statements can work with header line except 'on change of' event.
regards..
seshu.
Jogdand M B  
Hi,
At New.
Effect
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.
Example:
LOOP AT itab result ...
    [AT NEW comp1.
     ENDAT.
endloop.
On Change of:
Effect:
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..
Example:
In a SELECT loop, a statement block should only be executed if the content of the column CARRID has changed.
DATA spfli_wa TYPE spfli.
SELECT *
       FROM spfli
       INTO spfli_wa
       ORDER BY carrid.
  ON CHANGE OF spfli_wa-carrid.
  ENDON.
ENDSELECT.

Similar Messages

  • What is the exact diff between  At New  and On Chnage

    hello all
    what is the exact diff between  At New  and On Chnage in control breaks statements. and when  shall we go for At new & when shall we go for On change on events.
    Plz tell with with some code.

    Hi ,
    Using at new
    Each time the value of c changes, the lines of code between at new and endat are executed. This block is also executed during the first loop pass or if any fields to the left of c change. Between at and endat, the numeric fields to the right of c are set to zero. The non-numeric fields are filled with asterisks (*). If there are multiple occurrences of at new, they are all executed. at end of behaves in a similar fashion.
    Using the on change of Statement
    Another statement you can use to perform control break processing is on change of. It behaves in a manner similar to at new.
    The following points apply:
    u2022     If the value of any of the variables (v1, v2, and so on) changes from one test to the next, the statements following on change of are executed.
    u2022     If no change is detected and else is specified, the statements following else are executed.
    on change of differs from at new in the following respects:
    u2022     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.
    u2022     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.
    u2022     When used within a loop, a change in a field to the left of the control level does not trigger a control break.
    u2022     When used within a loop, fields to the right still contain their original values; they are not changed to contain zeros or asterisks.
    u2022     You can use else between on change of and endon.
    u2022     You can use it with loop at it where . . ..
    u2022     You can use sum with on change of. It sums all numeric fields except the one(s) named after of.
    u2022     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,
    KV

  • 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

  • Hi Friends what are the actual differences between  AT NEW & ON CHANGE

    what are the actual differences between  AT NEW & ON CHANGE ? can you list some of the differences?

    Hi,
    At New
    1. When a new record comes at new triggers. Atnew only used inside loop and endloop.
    2. At new is controlbreak statment on at new the left side field change, the event
    trigers and the values become 0 and *
    On Change
    1. On change of works same like at-new but the diff is it can be used out side of a loop,like select and endselect,case endcase.
    2.. on change of is not a control break statement and we can use onchange of out side the loop
    and
    The Major difference between the two is that AT NEW can be used ONLY for INTERNAL TABLES, while ON CHANGE OF can be used for any loop processing i.e do..enddo, while..endwhile and loop..endloop also.
    AT NEW <field>
    The block will be executed when the SY-TABIX is 1 (or) when the SY-TABIX 1 value has a change with the SY-TABIX value.
    With this block the field towards the right to the field are not accessable with in the block, and are shown with '*'. They can be accessed outside the block.
    ON CHANGE OF <itab>-<field>
    The block also works similar to the AT First. In this block all the fields are accesseble.
    ON CHANGE OF triggers whenever there is a change in that particular field.
    AT NEW triggers whenever there is a change in the fields before that particular field.ie. if there is a change in that combinations from the first field.
    On change off' works on variabels. The 1st time the statement isreached a memory copy is made of the value. The next time the statementis reached, the current value is compared to the stored value. If thereis a difference, the coding between ON... and ENDON. is executed. Youcan use this for a table workarea field, but if you have the table loopin a routine and the routine called several times, you can get unwantedresults. (Check the value of the last loop with the value of the firstnew loop.)
    The AT NEW (and others like AT END OF...) are specially for table loopprocessing. The coding between AT new FIELD and ANDAT is triggerdwhenever a the field or any field defined to the left is changed. Yourtable should be sorted by all fields from the left up to the consideredFIELD. Btw all fields to the right contain *, so it can be usefull tohave a second workarea filled to be printed or what ever you want.
    REWARD IF HELPFUL
    RAAM

  • What are the major differences between 4.7 and ecc5.0

    hi all
    What are the major differences between 4.7 and ecc5.0
    regards
    JK Rao

    Hi,
    Good morning and greetings,
    Please use the following link
    http://solutionbrowser.erp.sap.fmpmedia.com
    Please reward points if found useful
    Thanking you
    With kindest regards
    Ramesh Padmanabhan

  • What is the exact difference between Purchse order and purchase requisition

    Hi all,
    What is the exact difference between Purchse order and purchase requisition.
    Thx

    Hi,
    <b>Purchase Requisition</b>-> Staff in an orgn places Pur requisition for want of some goods/products - ME51
    Related Table EBAN
    Request for Quotation(RFQ)-> The Purchase dept in the orgn calls/requests for the quotation for the products against which PR was raised. - ME41
    Vendor Evaluation->After receving the RFQ's, after comparison a Vendor is finalised based on the terms and conditions.
    <b>Purchase Order(PO)</b>-> Pur order was issued to that vendor asking him to supply the goods/products -ME21N
    Tables:EKKO,EKPO
    Goods Receipt Note(GRN)->Vendor supplies the material/Products to the orgn-
    MB01
    Goods Issue (GI) -> People receives their respective itesm for which they have placed the Requisitions
    Vendor, Material ,Qty are mandatory for PO.
    Regards,
    Padmam.

  • What is the fundamental diff between physical standby and logical standby ?

    What is the fundamental difference between logical standby and physical standby ?
    What if I create a physical standby , now I would like to ask that is it possible to open it on read only mode ? If not , then why not ?
    hare krishna
    Alok

    Nothing will explain you better Oracle than Oracle documentation :<br>
    Standby Database Types<br>
    <br>
    Nicolas.

  • What is the main difference between f.13 and f13e

    Hi,
       What is the main difference between f.13 and f13e.
      when clearing the document do they follow deifferent steps in selection?
    Thanks,
    Sravanthi

    Hi,
    The reason "Clearing currency" is provided is because you can clear in any currency apart from local currency. For eg if your local currency is INR and Document currency (Invoice) is USD and the customer pays in EUR, you can still clear them with the Clearing currency EUR. On the date of payment, Open items in USD will be converted into Clearing currency EUR as follows: USD to INR and from INR to EUR. (based on exchange rates between USD-INR and INR-EUR).
    Jayaram

  • What is the basic difference between Hyperion Planning and HFM

    Hi GURU'S,
    what is the basic difference between Hyperion Planning and HFM and when do we choose them.

    On a high level the difference is this:
    1. HFM is best for global collection (collecting data from scattered entities), group consolidation and for easily structuring financial reporting (mainly consisting of financial data)
    2. Planning is best for modeling your business, starting from a demand forecast and arriving to capacity planning and finally to financial statements, by utilizing business drivers (non-financial data like volumes, prices, productivity rates etc)
    Of course, differences may be analyzed at several levels down to technical, but the discussion may turn out to be too long, yet adding little value to the question: "when do we choose the one over the other". Bear in mind that your requirements may turn out that you need both.

  • 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

  • Differnce between AT NEW AND ON CHANGE OF

    Hi,
    Differnce between AT NEW AND ON CHANGE OF
    Iam waiting foryour reply
    Thanks & Regards
    Raja Sekhar.T

    Hai Raja
    check the following Documents
    1. AT NEW f.
    2. AT END OF f.
    3. AT FIRST.
    4. AT LAST.
    5. AT fg.
    Effect
    In a LOOP which processes a dataset created with EXTRACT , you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT . The sequence of statements which lies between them is then executed if a control break occurs.
    You can use these key words for control break processing with extract datasets only if the active LOOP statement is proceesing an extract dataset.
    The control level structure with extract datasets is dynamic. It corresponds exactly to the sort key of the extract dataset, i.e. to the order of fields in the field group HEADER by which the extract dataset was sorted .
    At the end of a control group ( AT END OF , AT LAST ), there are two types of control level information between AT and ENDAT :
    If the sort key of the extract dataset contains a non-numeric field h (particularly in the field group HEADER ), the field CNT(h) contains the number of control breaks in the (subordinate) control level h .
    For extracted number fields g (see also ABAP/4 number types ), the fields SUM(g) contain the relevant control totals.
    Notes
    The fields CNT(h) and SUM(g) can only be addressed after they have been sorted. Otherwise, a runtime error may occur.
    The fields CNT(h) and SUM(g) are filled with the relevant values for a control level at the end of each control group ( AT END OF , AT LAST ), not at the beginning ( AT FIRST , AT NEW ).
    When calculating totals with SUM(g) , the system automatically chooses the maximum field sizes so that an overflow occurs only if the absolute value area limits are exceeded.
    You can also use special control break control structures with LOOP s on internal tables.
    Variant 1
    AT NEW f.
    Variant 2
    AT END OF f.
    Effect
    f is a field from the field group HEADER . The enclosed sequence of statements is executed if
    the field f occurs in the sort key of the extract dataset (and thus also in the field group HEADER ) and
    the field f or a superior sort criterion has a different value in the current LOOP line than in the prceding ( AT NEW ) or subsequent ( AT END OF ) record of the extract dataset.
    Example
    DATA: NAME(30),
          SALES TYPE I.
    FIELD-GROUPS: HEADER, INFOS.
    INSERT: NAME  INTO HEADER,
            SALES INTO INFOS.
    LOOP.
      AT NEW NAME.
        NEW-PAGE.
      ENDAT.
      AT END OF NAME.
        WRITE: / NAME, SUM(SALES).
      ENDAT.
    ENDLOOP.
    Notes
    If the extract dataset is not sorted before processing with LOOP , no control level structure is defined and the statements following AT NEW or AT END OF are not executed.
    Fields which stand at hex zero are ignored by the control break check with AT NEW or AT END OF . This corresponds to the behavior of the SORT statement, which always places unoccupied fields (i.e. fields which stand at hex zero) before all occupied fields when sorting extract datasets, regardless of whether the sort sequence is in ascending or descending order.
    Variant 3
    AT FIRST.
    Variant 4
    AT LAST.
    Effect
    Executes the relevant series of statements just once - either on the first loop pass (with AT FIRST ) or on the last loop pass (with AT LAST ).
    Variant 5
    AT fg.
    Addition
    ... WITH fg1
    Effect
    This statement makes single record processing dependent on the type of extracted record.
    The sequence of statements following AT fg are executed whenever the current LOOP record is created with EXTRACT fg (in other words: when the current record is a fg record).
    Addition
    ... WITH fg1
    Effect
    Executes the sequence of statements belonging to AT fg WITH fg1 only if the record of the field group fg in the dataset is immediately followed by a record of the field group fg1 .
    Basic form
    ON CHANGE OF f.
    Addition
    ... OR f1
    Effect
    Executes the processing block enclosed by the " ON CHANGE OF f " and " ENDON " statements whenever the contents of the field f change (control break processing).
    Normally, you use the statement to manipulate database fields during GET events or SELECT / ENDSELECT processing.
    Note
    There are special control structures for processing control breaks in LOOP s on internal tables or extract datasets AT ).
    ON CHANGE OF is unsuitable for recognizing control levels in loops of this type because it always creates a global auxiliary field which is used to check for changes. This global auxiliary field can only be changed in the relevant ON CHANGE OF statement. It is not reset when the processing goes into loops or subroutines, so unwanted effects can occur if the loop or subroutine is executed again. Also, since it is set to its initial value when created (like any other field), any ON CHANGE OF processing will be executed after the first test, unless the contents of the field concerned happen to be identical to the initial value.
    Example
    TABLES T100.
    SELECT * FROM T100 WHERE SPRSL = SY-LANGU AND
                             MSGNR < '010'
                       ORDER BY PRIMARY KEY.
      ON CHANGE OF T100-ARBGB.
        ULINE.
        WRITE: / '**', T100-ARBGB, '**'.
      ENDON.
      WRITE: / T100-MSGNR, T100-TEXT.
    ENDSELECT.
    Displays all messages with their numbers in the logon language, provided the number is less than '010'.
    Each time the message class changes, it is output.
    Addition
    ... OR f1
    Effect
    Also executes the code whenever the contents of the field f1 changes.
    You can use this addition several times.
    Example
    Logical database F1S
    TABLES: SPFLI, SFLIGHT, SBOOK.
    GET SBOOK.
      ON CHANGE OF SPFLI-CARRID   OR
                   SPFLI-CONNID   OR
                   SFLIGHT-FLDATE.
        ULINE.
        WRITE: /5 SPFLI-CARRID, SPFLI-CONNID,
                5 SFLIGHT-FLDATE, SPFLI-FLTIME,
                5 SFLIGHT-SEATSMAX, SFLIGHT-SEATSOCC.
      ENDON.
      WRITE: / SBOOK-CUSTOMID.
    The code between ON CHANGE OF and ENDON is executed only if at least one of the fields SPFLI-CARRID , SPFLI-CONNID or SFLIGHT-FLDATE has changed, i.e. there is a different flight connection (which also has bookings).
    Notes
    Thanks & regards
    Sreenivasulu P

  • What are the major differences between hana 2013 and 2014 release

    Hi Guys,
    I am planning to learn sap hana and write certification exam. As sap release new platform 2014, may I know what are the major deference between 2013 and 2014 release or its just enhancement pack on top of 2013.
    Please help me....thank you in advance.
    Regards,
    Tapas

    Hi,
    Good morning and greetings,
    Please use the following link
    http://solutionbrowser.erp.sap.fmpmedia.com
    Please reward points if found useful
    Thanking you
    With kindest regards
    Ramesh Padmanabhan

  • What are the major differences between UCCX v7 and v8.0.2

    Does anyone know of a matrix or document which shows the major differences between UCCX v7 and v8.0.2?
    I have looked high and low, even searched this forum, but have not found anything.
    I've even looked at release notes in 8.0.2 but couldn't see anywhere that states the changes.
    Any help appreciated.

    Hi,
    I have awarded you both with the 'correct answer'.
    I went through, painstakingly, the documents I was linked to above and compared.
    In the end the major differences are pretty much what you have outlined here - which is exactly what I wanted.
    Thank you both very much.
    Cheers,
    Brett
    PS: Here are the obvious differences I found going thru the documentation I was linked to... (pretty much what you said)
    Feature
    V7
    V8
    High   Availability over the WAN (HAoWAN)
    No
    Yes
    Available in   an Appliance Model
    No
    Yes
    Read-only access to Cisco Unified Contact Center Express   database (Informix) with JDBC, ODBC, or Structured Query Language (SQL)
    No
    Yes
    System   Software Configuration
    MS Windows Server   2003
    Cisco Media   Convergence Appliance Software
    System   Software Configuration (client)
    XP and Vista
    XP, Vista, and Win7
    System   Software Configuration (browser based client software)
    No
    CAD and Workforce   Management
    System   Software Configuration (Web 2.0 based client software)
    No
    QM and AQM
    Operating   System
    Cisco OEM Windows   Server 2003
    Cisco Voice OS

  • What are the major differences between oracle 10g and oracle express 10g

    Hi
    Can anyone tell, What are the major differences between[b] oracle 10g and oracle express 10g.
    Or if you know any URL, then please do let me know.
    Advance Thanks
    JC

    Dear sir,
    here it is.
    http://www.oracle.com/database/product_editions.html

  • What is the exact difference between Database Cloning and Database Refresh?

    Hi,
    Can anybody tel me the exact difference between Database Cloning and Database Refresh?
    I Have some conflicts in these topics.
    Thanks
    Rajesh

    Refresh is what it says, "refresh" . You have a main site which would always have the data being inserted into it. There would be another site which would remain some where else . This site needs to be refreshed with the primary site. So you need to do export from the primary, push it to the secondary site and done!
    HTH
    Aman....

Maybe you are looking for