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

Regarding .include and .append

Former Member
0 Likes
553

hello all,

what is the difference between .INCLUDE and .APPEND. when creating a table when to use .INCLUDE and when to use .APPEND. please clarify.

Thanks in advance

Regards

venkata prasad

4 REPLIES 4
Read only

Former Member
0 Likes
533

Hi

<b>Using INSERT we can insert at end and also at any position using Index but Through APPEND we acan insert the line at End only

</b>

<b>Inserting Lines Using the Index </b>

The INSERT statement allows you not only to insert lines in any type of internal table, but also allows you to change them using a line index. You can insert either a single line or a group of lines into index tables using the index.

<b>Appending a Single Line</b>

To add a line to an index table, use the statement:

APPEND <line> TO <itab>.

<line> is either a work area that is convertible to the line type, or the expression INITIAL LINE. If you use <wa>, the system adds a new line to the internal table <itab> and fills it with the contents of the work area. INITIAL LINE appends a blank line containing the correct initial value for each field of the structure. After each APPEND statement, the system field SY-TABIX contains the index of the appended line.

Appending lines to standard tables and sorted tables with a non-unique key works regardless of whether lines with the same key already exist in the table. Duplicate entries may occur. A runtime error occurs if you attempt to add a duplicate entry to a sorted table with a unique key. Equally, a runtime error occurs if you violate the sort order of a sorted table by appending to it.

Regards Rk

Read only

Former Member
0 Likes
533

Hi

Shortly:

Append structures are used for enhancements that are not included in the standard. An append structure is a structure that is assigned to exactly one table or structure. There can be more than one append structure for a table or structure.

http://help.sap.com/saphelp_erp2004/helpdata/en/cf/21eb61446011d189700000e8322d00/content.htm

Includes are used to group fields, an include structure can be assigned to many tables. If you add a fields to an include structure, all tables/structures, which contain that include structure, will be updated too.

http://help.sap.com/saphelp_erp2004/helpdata/en/cf/21ea6a446011d189700000e8322d00/content.htm

For enhancing SAP standard you can use customising includes too, if there are any in your table.

http://help.sap.com/saphelp_erp2004/helpdata/en/cf/21eb54446011d189700000e8322d00/content.htm

Regards

Sudheer

Read only

Former Member
0 Likes
533

Read only

Former Member
0 Likes
533

APPEND structures are used to add additional fields to exactly one table

INCLUDE structure is used to include fields to several tables.