cancel
Showing results for 
Search instead for 
Did you mean: 

control break events

0 Kudos

what is difference between AT NEW..... and ON CHANGE OF.......?

Accepted Solutions (0)

Answers (10)

Answers (10)

raja_narayanan2
Active Participant
0 Kudos

At new will be used only within the loop.......endloop.

the statements below that is executed only when there is any change in the value of the particular field.

loop at <itab>

At new <field>

...........

.................

endat.

endloop.

On change of can be used within loop....endloop, select.....endselect, while, Do.

On change of v1

..........

........

End on.

The statement b/w this is executed if there is any change in the value of the field during each loop pass.

Former Member
0 Kudos

hi kadam,

AT NEW FIELD:

it compares with the previous record of the onternal table whether the value is different or not. if different this event is triggered. Used only ib LOOP AT i.e., only for internal table.

ON CHANGE OF:

it creates one more variable internally and check with the variable of the internal table. if different event is triggered.

initial value should mis-match. Used in DO, WHILE, LOOP AT..

generally we dont go for on change of.

luck,

pritam.

Former Member
0 Kudos

Hi,

I avoid both of those as they can cause problems. I do it with my own variables which gives me more control and doesnt hide any data!

Kind regards

Ash Thomas

Sap Consultant

<a href=http://www.ashpeople.com>Ash People, Sap Consultants & Sap Consultancy</a>

<a href=http://www.ashpeople.com>www.ashpeople.com</a>

Former Member
0 Kudos

AT NEW <field> is used when the field is a first element in the structure.

(IF the field used in AT NEW is not the first element in the structure, all the character field which cross in that loop will become ***, to overcome this ON CHANGE OF is used)

ON CHANGE OF <field> is used when the <field> is not the first element in the structure.

Former Member
0 Kudos

Hi,

AT NEW ONCHANGE

This is the event allowed only This is the event allowed only

with in the loop ...endloop. outside looping statements.

It considers the change in left This doesn't consider left side

side alphanumeric characters. alphanumeric characters.

Hope tis answer helps u.

Reward with points if ur question is answered.

Bye...........

Edited by: SreeRekha Myadam on Apr 8, 2008 11:05 AM

Former Member
0 Kudos

Hi,

Both at new and on change are used within the loop.

But the difference is that on change will be triggered whenever the data in that particular field changes, at new is triggered whenever the data in the fields which are present before that control level changes.

Former Member
0 Kudos

how to use at new and onchange control break events in ALV Programs........

thanks in advance...

Former Member
0 Kudos

Hi

At new is trigger whenever there is any change in al lthe fields from the left to that of the particular field.

But On change is triggers only when there is any change in the particular field.

AT new we use with in the loop but onchange we can use outside the loop.

Former Member
0 Kudos

Hi Sai

Please check this link

Hope this answer your question

Reward point if useful.

Thanks

Raziq

Former Member
0 Kudos

hai,

At new and on change of both are used for displaying output.. The only difference is At new is used within the loop and On change of is used outside the loop... I hope this information may help you

Former Member
0 Kudos

at new

write kunnr, mandt.

endat.

o/p 123 *** ** .

set flag

at new

flag = `x`.

endat.

if flag = 'x'.

write kunnr, mandt.

endif

123 200.

ON CHANGE on problem.