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: 

Diff b/w Include structure and append structure

Former Member
0 Kudos

Can anyone explain the difference between Include structure and Append structure?

6 REPLIES 6

Former Member
0 Kudos

HI,

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

This has been discussed please check it in forum

https://forums.sdn.sap.com/click.jspa?searchID=480466&messageID=114309

https://forums.sdn.sap.com/click.jspa?searchID=480466&messageID=1419481

https://forums.sdn.sap.com/click.jspa?searchID=480466&messageID=1479212

Regards,

Priyanka.

Former Member
0 Kudos

Hi,

Difference between append & include structure:

Append structures are used for enhancements which are not provided for in the standard SAP(country versions and adding customer fields to SAP standard tables).

An append structure can be used only for the table it is created.

An include structure is reusable ,that is it can be used can be used in several tables.If you add a field to an include structure, all tables that contain that include structure will be updated.

from

Seshu.

paruchuri_nagesh
Active Contributor
0 Kudos

hi

append atructures is used for enhancements

.include structures are reusable

regards

Nagesh.Paruchuri

Former Member
0 Kudos

Hi

<b>Append Structure</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>INCLUDE tructure</b>

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

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>

Former Member
0 Kudos

INCLUDE


-In addition to listing the individual fields, you can also include the fields of another structure in tables and structures. Individual fields and includes can be mixed as required.
-When an include is changed, all the tables and structures that include it are automatically adjusted.
-Structure A was included in table B. A new field is inserted in structure A. When structure A is activated, table B is adjusted to this change, that is the new field is also inserted there.

-You can assign the include a group name with which the group of fields in the include can be addressed as a whole in ABAP programs.

-Includes can also be nested, that is structure A includes structure B which in turn includes another structure C, etc. The maximum nesting depth is limited to nine. The maximum length of a path of nested includes in a table or structure is therefore nine (the table/structure itself not included).

-Only flat structures can be included. In a flat structure, every field either refers to a data element or is directly assigned a data type, length and possibly decimal places.

-Only structures may be included in a table. Tables, structures and views may be included in a structure.

-The length of the field names is more restricted in tables than in structures. In a table, a field name may not have more than 16 places, but in a structure up to 30 places are allowed for the field name. A structure therefore can only be included in a table if none of the field names of the structure are longer than 16 places.

-The path of nested includes may only contain one table.

-Table TAB1 includes structure STRUCT1, which in turn includes structure STRUCT2. The path of the nested includes here only contains table TAB1. It is also possible to include TAB1 in a further structure STRUCT0,

-but no other table TAB2 may be included in TAB1 since in this case a path of nested includes would contain two tables (TAB1 and TAB2).


Inserting an Include :



Prerequisites

Only flat structures may be included in a table. No field refers to another structure in a flat structure. All the fields of a flat structure therefore refer either to a data element or were directly assigned a data type, field length and decimal places.

A field name may not have more than 16 places in a table. A structure therefore can only be included in a table if none of the field names of the structure are longer than 16 places.

Procedure

Place the cursor under the line in which you want to insert the include and choose Edit ® Include ® Insert.
A dialog box appears.

Enter the structure name. You can optionally enter a group name (see Named Includes) or a three-place suffix.
With the group name, you can access the fields in the include together in ABAP programs.

The suffix can be used to avoid name collisions between fields of the include and fields already in the table. The suffix is added to all the fields of the include, whereby the field name is first truncated if necessary.

Choose .
A line with .INCLUDE in the Fields field and the name of the include in the Field type field is inserted in the field maintenance screen for the table.

Select column Key if all the fields in the include should be key fields of the table.
The table key must be at the start of the field list. If you select column Key, you must insert the include after the last key field or between the existing key fields of the table.

If you do not select column Key, none of the included fields is a key field of the table.

Choose 'ACTIVATION'.
Result

The fields of the include are added to the table in the database. If you inserted the fields of the include as key fields, the primary index of the table is built again.

You can find information about the activation flow in the activation log, which you can display with Utilities ® Activation log. The activation log is displayed immediately if errors occur when the table is activated.

Other Options

You can display the fields contained in an include by placing the cursor on the line of the include and choosing . The fields of the include are now shown below this line. You can cancel this action with .

You can expand all the includes contained in a table with . Cancel this action with .

You can copy the fields contained in the include directly to the table with Edit ® Include ® Copy components. The fields of the include become table fields. They are no longer adjusted to changes in the include.


APPEND :



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 R/3 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


Adding Append Structures :



Go to change mode in the maintenance screen of the table where you want to add the append structure.
If the table contains a long field (data type VARC, LCHR or LRAW), you cannot add an append structure.

Choose Goto ® Append structures.
Either a dialog box appears in which you can enter the name of the append structure or a list of all the append structures. that were already created for the table appears. If append structures already exist, you have to choose to get the dialog box for entering the name.

Enter the append structure name and choose . The name must lie in the customer namespace.
You go to the field maintenance screen of the append structure.

Define the fields of the append structure. You can proceed as when creating a normal structure with two restrictions (see Creating Structures).
The fields of an append structure must lie in the customer namespace, that is the field names must begin with ZZ or YY. This prevents conflicts with fields inserted in the table by SAP.

An append structure must be flat, that is each field of the append structure must either refer to a data element or be directly assigned a data type, length, decimal places and short text.

If you want to create foreign keys or search help attachments for table fields that already exist, you can display these fields with Show appending objects. Proceed as if you wanted to create the foreign key or search help attachment in the underlying table (see Creating Tables).
If a foreign key or search help attachment is already defined for a field in the table, you cannot change this definition with the append structure.

Choose 'activation button .
Result

The table will also be activated when the append structure is activated. The fields of the append structure are appended to the table in the database. Foreign keys or search help attachments for the fields that are already in the table and that were defined with the append structure are also activated.

You can display information about the activation process with Utilities ® Activation log. Errors occurring when the append structure is activated are displayed directly in the activation log.

Reward with points if helpful.

regards,

Vijay

Former Member
0 Kudos

Hi,

Check the links -

/message/1479212#1479212 [original link is broken]

Please reward.