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: 

Append and Insert

Former Member
0 Kudos

I am not clear with the difference between append and insert. Hence append is one which add a particular tuple into last of an internal table but while using insert also it gives the same while using at programmiing. So, please clear this concept.

Regards,

Venkat

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Both Append and Insert are used for the Internal Tables ...

But Append only apeends a REcord at Last in the ITab.. But Insert using Insetrt statement can be done at any point.........

You can use Append and Insert for Standard Tables But u cannot use Append for Sorted or Generic Tables.. because it will apeend at end only..then the sorted order will be violated then u will get the shortdump..

so for sorted or generic type of tables u have to use Insert rather than Append...

Babu...

Edited by: venkoji babu on Feb 23, 2008 10:29 AM

4 REPLIES 4

Former Member
0 Kudos

Both Append and Insert are used for the Internal Tables ...

But Append only apeends a REcord at Last in the ITab.. But Insert using Insetrt statement can be done at any point.........

You can use Append and Insert for Standard Tables But u cannot use Append for Sorted or Generic Tables.. because it will apeend at end only..then the sorted order will be violated then u will get the shortdump..

so for sorted or generic type of tables u have to use Insert rather than Append...

Babu...

Edited by: venkoji babu on Feb 23, 2008 10:29 AM

Former Member
0 Kudos

with 'append'.appended record will save it on the end of the internal table.

with 'insert' record will be placed where ever u want.

Former Member
0 Kudos

Append:Can be used with Standard internal table.

Insert:Can be used with standard,hashed and sorted internal table.

append always adds entry at the end of internal table.

insert for standard tables adds at end or index specified.

for sorted and hashed it will add entry as per the key given.

please reward if useful.

Former Member
0 Kudos

Hi ,

- To add lines to internal table either by singly or groups

INSERT <WA> INTO TABLE <ITAB>

- To add several lines to an internal table

INSERT LINES OF <ITAB> [FROM <N1>] [TO <N2> ] INTO TABLE <ITAB2>

<ITAB1> AND <ITAB2> ARE TABLES WITH A COMPATIBLE LINE TYPES.

- APPEND <WA> TO <ITAB> :

or

APPEND lines of <itab1> to <itab2>.

Append only appends a record at Last in the itab and Insert using Insert statement can be done at any point

Thanx

Jagadeesh.G.

Edited by: Jagadeshwar Gollapelly on Feb 23, 2008 11:48 AM