Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ASSIGNING addition used in the LOOP statement

Former Member
0 Kudos

Hello Guys ,

I have a problem about at new and at end statements, basically I want to use them in a loop with assigning like this :

loop at ti_itab assigning <wa_itab>.
    at new of kunnr.
   
    endat.
    at end of xref1.
   
    endat.
 endloop.

xref1 and kunnr are fields of my table itab , this is the correct form of do this ? I don´t know why the at statements are doing control breaks for every single register in my table ( even when both have the same value of the previous register ) , could you give me an example please. should i use at new of <wa_itab>-kunnr it doesnt work either ?

thank you very much,.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

In your ti_itab internal table, kunnr is at which position?

Basically it checks all the columns till kunnr if any of the value changes, At new will be triggered.

4 REPLIES 4

Former Member
0 Kudos

In your ti_itab internal table, kunnr is at which position?

Basically it checks all the columns till kunnr if any of the value changes, At new will be triggered.

0 Kudos

Hi,

Try to bring the KUNNR field as first colum in your ti_itab table , So that AT new will work perfectly.

Then you can use the at end for XREF1 field.

Former Member
0 Kudos

Hi

It can depend on the postions of those fields in the structure of your internal table, because those events can be triggered if a value of the field and/or of a field on the left is changed.

Max

Former Member
0 Kudos

Hi José,

Click on below link:

BR

Dep