Skip to Content
author's profile photo Former Member
Former Member

ASSIGNING addition used in the LOOP statement

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,.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2011 at 10:28 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2011 at 11:39 AM

    Hi José,

    Click on below link:

    BR

    Dep

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2011 at 10:31 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.