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 and include

Former Member
0 Likes
2,476

When do you use .APPEND and .INCLUDE to modify SAP tables?

8 REPLIES 8
Read only

former_member404244
Active Contributor
0 Likes
1,283

Hi,

If u want to use for reusability purpose then go for .include,if u want that my new fields should be table specific and it can't be reused then go for .append.

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,283

An append structure can only be assigned to exactly one table or structure. If you want to append the same fields to several tables or structures, you can store these fields in an include structure. In this case you must create an append structure for each of these tables or structures and include the include structure there.

But there is no such restriction on Inclue. You can include the same structure in several tables.

Check the following...

Append Structures

Append structures are used for enhancements that are not included in the standard. This includes special developments, country versions and adding customer fields to any tables or structures.

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.

The following enhancements can be made to a table or structure TAB with an append structure:

· Insert new fields in TAB,

· Define foreign keys for fields of TAB that already exist,

· Attach search helps to fields of TAB that already exist,

These enhancements are part of the append structure, i.e. they must always be changed and transported with the append structure.

When a table or structure is activated, all the append structures of the table are searched and the fields of these append structures are added to the table or structure. Foreign keys and search help attachments added using the append structure are also added to the table. If an append structure is created or changed, the table or structure assigned to it is also adjusted to these changes when the append structure is activated.

Since the order of the fields in the ABAP Dictionary can differ from the order of the fields on the database, adding append structures or inserting fields in such append structures does not result in a table conversion.

The customer creates append structures in the customer namespace. The append structure is thus protected against overwriting during an upgrade. The fields in the append structure should also reside in the customer namespace, that is the field names should begin with ZZ or YY. This prevents name conflicts with fields inserted in the table by SAP.

If you create an append structure for a table or structure, only those enhancements are allowed that are consistent with the enhancement category of the enhanced table or structure. For more information, see Structure Enhancements.

The new versions of the standard tables are imported after an upgrade, and the fields, foreign key definitions and search help attachments contained in the append structures are added to the new standard tables at activation.

A standard table contains the fields Field 1, Field 2 and Field 3. An append structure containing the fields ZZA and ZZB is defined for this table. After activating the table, the corresponding database table contains fields Field 1, Field 2, Field 3, ZZA and ZZB.

Further Remarks:

· An append structure can only be assigned to exactly one table or structure. If you want to append the same fields to several tables or structures, you can store these fields in an include structure. In this case you must create an append structure for each of these tables or structures and include the include structure there.

· Adding an append structure to an SAP standard table is supported by the Modification Assistant.

· If you want to insert a field that is to be delivered with the standard in the next Release in the customer system in advance, you must include it in the table itself as a repair. If you include such a field in an append structure for the table, it will occur twice when the new standard table is imported. This will result in an activation error.

· No append structures may be added to tables with long fields (data types VARC, LCHR or LRAW). This is because a long field must always be the last field in the table. However, structures with long fields can be enhanced with append structures.

· If a table or structure with an append structure is copied, the fields of the append structure become fields of the target table. Foreign key definitions and search help attachments appended with the append structure are copied to the target table.

· Foreign keys for the appended fields must be defined within the append structure. Fields of the table or structure assigned to the append structure may be defined when assigning the key field and foreign key field.

· Indexes on the appended fields must be defined in the original table.

· A table or structure TAB can only be enhanced with new foreign keys or search help attachments using an append structure. You therefore cannot change an existing foreign key definition or search help attachment for a field of TAB with the append structure.

Regards

Read only

Former Member
0 Likes
1,283

Hi abap,

1. .INCLUDE

(which appears in se11 in many tables.)

2. Well,

thats nothing but a technique

of BUNCHING / GROUPING fields

(for ease of re-use)

(instead of again and again

specifying those SET of FIELDS,

in more than 1 table)

(we can as well give each field, field-by-field,

it won't make any difference in database table)

3. However,

Append structure

is FACILITY PROVIDED BY SAP

for customer enhancment of tables.

It behaves differently when

some upgrade is done in that table

by sap itself.

In such case,

when the upgrade occurs,

first the SAP fields (which are added in the standard table)

are first included in the sequence of fields,

AFTER THAT,

our APPEND structure fields,

are appended !!!

regards,

amit m.

Read only

Former Member
0 Likes
1,283

hi,

Check this out

Regards,

Santosh

Read only

Former Member
0 Likes
1,283

An append structure can only be assigned to exactly one table or structure. If you want to append the same fields to several tables or structures, you can store these fields in an include structure. In this case you must create an append structure for each of these tables or structures and include the include structure there.

But there is no such restriction on Inclue. You can include the same structure in several tables.

Check the following...

Append Structures

Append structures are used for enhancements that are not included in the standard. This includes special developments, country versions and adding customer fields to any tables or structures.

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.

The following enhancements can be made to a table or structure TAB with an append structure:

· Insert new fields in TAB,

· Define foreign keys for fields of TAB that already exist,

· Attach search helps to fields of TAB that already exist,

These enhancements are part of the append structure, i.e. they must always be changed and transported with the append structure.

When a table or structure is activated, all the append structures of the table are searched and the fields of these append structures are added to the table or structure. Foreign keys and search help attachments added using the append structure are also added to the table. If an append structure is created or changed, the table or structure assigned to it is also adjusted to these changes when the append structure is activated.

Since the order of the fields in the ABAP Dictionary can differ from the order of the fields on the database, adding append structures or inserting fields in such append structures does not result in a table conversion.

The customer creates append structures in the customer namespace. The append structure is thus protected against overwriting during an upgrade. The fields in the append structure should also reside in the customer namespace, that is the field names should begin with ZZ or YY. This prevents name conflicts with fields inserted in the table by SAP.

If you create an append structure for a table or structure, only those enhancements are allowed that are consistent with the enhancement category of the enhanced table or structure. For more information, see Structure Enhancements.

The new versions of the standard tables are imported after an upgrade, and the fields, foreign key definitions and search help attachments contained in the append structures are added to the new standard tables at activation.

A standard table contains the fields Field 1, Field 2 and Field 3. An append structure containing the fields ZZA and ZZB is defined for this table. After activating the table, the corresponding database table contains fields Field 1, Field 2, Field 3, ZZA and ZZB.

Further Remarks:

· An append structure can only be assigned to exactly one table or structure. If you want to append the same fields to several tables or structures, you can store these fields in an include structure. In this case you must create an append structure for each of these tables or structures and include the include structure there.

· Adding an append structure to an SAP standard table is supported by the Modification Assistant.

· If you want to insert a field that is to be delivered with the standard in the next Release in the customer system in advance, you must include it in the table itself as a repair. If you include such a field in an append structure for the table, it will occur twice when the new standard table is imported. This will result in an activation error.

· No append structures may be added to tables with long fields (data types VARC, LCHR or LRAW). This is because a long field must always be the last field in the table. However, structures with long fields can be enhanced with append structures.

· If a table or structure with an append structure is copied, the fields of the append structure become fields of the target table. Foreign key definitions and search help attachments appended with the append structure are copied to the target table.

· Foreign keys for the appended fields must be defined within the append structure. Fields of the table or structure assigned to the append structure may be defined when assigning the key field and foreign key field.

· Indexes on the appended fields must be defined in the original table.

· A table or structure TAB can only be enhanced with new foreign keys or search help attachments using an append structure. You therefore cannot change an existing foreign key definition or search help attachment for a field of TAB with the append structure.

Read only

varma_narayana
Active Contributor
0 Likes
1,283

Hi..

We can only use .APPEND on Standard Tables to add any new fields.

reward if Helpful.

Read only

Former Member
0 Likes
1,283

Hi

<b>Enhancing dictionary elements</b>

Enhance tables using Append structures.

Enhance tables using Customizing includes.

<b>Enhancement using Append structures</b>

Append structures allow you to attach fields to a table without actually having to modify the table itself. You can use the fields in append structures in ABAP programs just as you would any other field in the table.

Append structures allow you to enhance tables by adding fields to them that are not part of the standard. With append structures; customers can add their own fields to any table or structure they want.

Append structures are created for use with a specific table. However, a table can have multiple append structures assigned to it

The customer creates append structures in the customer namespace. The append structure is thus protected against overwriting during an upgrade. The fields in the append structure should also reside in the customer namespace, that is the field names should begin with ZZ or YY. This prevents name conflicts with fields inserted in the table by SAP

<b>Enh. using Customizing includes</b>

Some of the tables and structures delivered with the R/3 standard contain special include statements. These are often inserted in those standard tables that need to have customer-specific fields added to them. Such includes are Customizing includes. (CI).

A Customizing include is a structure that satisfies a special naming convention. The name of a Customizing include begins with ‘CI_’ and the include is in the customer namespace .

If enhancements are already planned in the R/3 standard using customer-specific fields, such Customizing includes are included. in the corresponding standard table or standard structure. The Customizing include (that is the definition of the structure itself) is usually first created in the customer system and filled with fields by special Customizing transactions.

The Customizing include field names must lie in the customer namespace just like field names in append structures. These names must all begin with either YY or ZZ.

<b>Append structures v/s Customizing includes</b>

In contrast to append structures, Customizing includes can be inserted into more than one table.

As an example the customizing include that we created (CI_DEMO) could be a part of multiple tables in the database whereas the append structure (ZDEMO_APPEND) can only be assigned to one table. (here MARA).

This provides for data consistency throughout the tables and structures affected whenever the include is altered.

<b>Reward if usefull</b>

Read only

Former Member
0 Likes
1,283

Simplified

.Append is an enhancement you add fields to SAP table (only at the last) without passing SSCR key (develper key)

.include is and modification instead of enhancement you can have .include can be included in mid of field list.. (you will need SSCR key to include .include statement in and sap table)

No rewards Plz