‎2007 Jul 24 8:28 AM
What is Append Structure and Include
How to add some extra fields to SAP database table
thanks
Pradeep Reddy M
‎2007 Jul 24 8:32 AM
Append Structures
rewards if useful.
++
‎2007 Jul 24 8:35 AM
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
Regards,
Priyanka.
‎2007 Jul 24 12:02 PM
For more info goto
http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb61446011d189700000e8322d00/frameset.htm
http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb61446011d189700000e8322d00/frameset.htm
<b>Append Structures </b>
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
<b> Includes </b>
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).
<b> Named Includes </b>
If an include is used to define a database table or structure, a name can be assigned to the included substructure. The group of fields in the include can be addressed as a whole in ABAP programs with this name.
In ABAP programs, you can either access the fields directly with <Table/structure name>-<Field name> or analogously with <Table/structure name>-<Group name>-<Field name>. You can access the fields of the group as a whole with <Table/structure name>-<Group name>.
Structure PERSON includes structure ADDRESS with the name ADR. ADDRESS has a field CITY. With PERSON-ADR you can address all the fields in structure ADDRESS. The included field CITY can also be addressed with PERSON-CITY or PERSON-ADR-CITY.
You can include a structure more than once (e.g. in a period group). Since direct access by field name should be permitted here, the included field names must be renamed to ensure that they are unique.
A suffix can be assigned to each group, extending the names of the group fields. The fields can then be addressed in ABAP programs with <Table/structure name>-<Field name (with suffix)> or <Table/structure name>-<Group name>-<Field name (with suffix)>.
Structure PERSON includes structure ADDRESS twice. An address is the private address with suffix H and name ADRH. The other address is the business address with suffix W and name ADRW. You can access field CITY in the private address with PERSON-CITYH or PERSON-ADRH-CITY.
The functionality of the named includes in the ABAP Dictionary corresponds to the ABAP construction INCLUDE TYPE ... AS ... RENAMING ... .
Reward if useful
Regards
Prax