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

append internal table

Former Member
0 Likes
4,104

Hello,

What I would like to do is append a line into an internal table at certain index using a single statement (if possible).

I can use The 3 glasses method to append a new line into an itab at certain index ...but I wonder if ABAP does not have an addition or a statement that does this thing in a single step...

Thank you.

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
2,656

Three glasses method? There is one statement for insert (NOT AN APPEND), into itab.

INSERT wa INTO itab INDEX index?

This is one single line of code!!!

9 REPLIES 9
Read only

Former Member
0 Likes
2,656

Hi,

To know what kind of keyword options are avialable:

just use the F1 help in SAP.

Type the keyword in ABAP editor and press F1.

Read only

Former Member
0 Likes
2,656

Hi,

Do F1 on 'insert' statement.

Regards,

Manoj Kumar P

Read only

Sm1tje
Active Contributor
0 Likes
2,657

Three glasses method? There is one statement for insert (NOT AN APPEND), into itab.

INSERT wa INTO itab INDEX index?

This is one single line of code!!!

Read only

Former Member
0 Likes
2,656

hi,

Populate the data in Itab header.Write an INSERT with index = 1. You will get the data as the first record in Itab.

likewise you can give any index no depending upon where you have to append a line.

Regards,

anand

Read only

Former Member
0 Likes
2,656

hi

you can use the statement APPEND ITAB to append the internal table.like

itab-field = 'Text'.

APPEND ITAB.

hope this helps

regards

Aakash Banga

Read only

Former Member
0 Likes
2,656

You can use following statement


INSERT wa INTO ITAB INDEX w_index.

Read only

Former Member
0 Likes
2,656

1) With APPEND statement one can add row/rows only to the end of an internal tabel.

2) If you wish to add row at any index then use INSERT statement and pass the index value.

Read only

SujeetMishra
Active Contributor
0 Likes
2,656

Hello,

APPEND keyword is enough to solve your problem.

read help for this statement.

regards,

sujeet

Read only

Former Member
0 Likes
2,656

Hi ,

You can refer the below link for further details :

http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb36e2358411d1829f0000e829fbfe/content.htm

Regards,

Radhika.