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: 

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

Former Member
0 Kudos

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?

6 REPLIES 6

sathyags
Active Participant
0 Kudos

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

Sandra_Rossi
Active Contributor

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?

0 Kudos

Hi Sandra,

Both Submit and dynamic table is important. I need to loop for different currency types entered by the user and use the submit statement for standard program RFBILA00.The data for each currency type obtained from outcome of submit statement will be stored in the dynamic table. The dynamic table will have dynamic columns for each currency type. I need to modify the dynamic table for each value of the currency type data obtained from submit statement.

0 Kudos
I don't understand. Is your issue about field symbols and ASSIGN ?

Sandra_Rossi
Active Contributor
0 Kudos

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

kiran_k8
Active Contributor

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.