Skip to Content
avatar image
-2
Former Member

How to modify a dynamic table inside a loop without affecting the previous values

I have a requirement where I need to use a Submit statement for a Standard program. This Submit statement shall be executed inside a loop and the ALV output of the Submit statement will be stored in the dynamic table.Now,for the next value of the loop statement the data got from the submit statement needs to be appended to this table based on the key fields. I am able to get the data into dynamic table for the first loop run but when it comes for appending the data during the second loop run ,I am facing the issue. Could someone help me out in this and guide for a proper approach?

Add comment
10|10000 characters needed characters exceeded

  • Sorry, but could you please post a short code snippet that we could run so that to understand your question and issue?

  • Reema,

    "This Submit statement shall be executed inside a loop"

    The above statement reads like a standard program will be submitted for as many records as there are in a loop.If that is the case,then definitely this will be equivalent to suicide from programming point of view.

    Kindly review your approach or share what exactly is the objective of your development so that you can get more apt replies.

    K.Kiran.

  • Get RSS Feed

2 Answers

  • Oct 31, 2017 at 01:46 PM

    To insert the lines of one internal table "source" into a sorted or hashed internal table "target" (of same structure of course), use INSERT LINES OF source INTO TABLE target. Of course, you'll have to handle the case if the primary key or a secondary key of the target internal table is unique.

    PS: is SUBMIT or dynamic table important in your question?

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 31, 2017 at 01:32 PM

    Use a temporary internal table and append the lines to global one in each loop iteration.

    Add comment
    10|10000 characters needed characters exceeded