Application Development and Automation 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: 
Read only

dynamically adding rows

Former Member
0 Likes
392

hai ,

how can i dynamically add new rows in the middle of an internal table without affecting the values of other rows in the table

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
371

Hi,

use INSERT syntax specify the index...

insert wa INTO itab  index 2.

Cheers,

jose.

2 REPLIES 2
Read only

Former Member
0 Likes
372

Hi,

use INSERT syntax specify the index...

insert wa INTO itab  index 2.

Cheers,

jose.

Read only

vinod_vemuru2
Active Contributor
0 Likes
371

Hi Scorpio,

U can use INSERT STATEMENT for this.

INSERT wa_tab TO itab INDEX l_tabix.

If u dont specify INDEX then u will get dump, Because ABAP Run time dont know where to insert the record.

So get the exact position of where to insert the record and specify that in INDEX.

If u are not able to get the exact position there is one alternate solution.

First append the records. After appending all the records SORT the internal table based on your requirement. This will also serves ur requirement.

Thanks,

Vinod.