2. Objectives
The participants will be able to:
– Define a Structure and Substructure and describe
their usage.
– Define a Customizing Include and explain its
usage.
– Define an Append Structure and explain its usage.
March-2005 Adding Structures | 2.05 2
3. Including Structures in Tables
March-2005 Adding Structures | 2.05 3
Table XYZ
.INCLUDE CI_XXX
Table T
.APPENDZAT
Append StructuresAppend Structures
Customizing Includes
Customer Tables SAP Tables
SAP Tables
Field 1
Field 2
...
Field n
Structure is a group of fields that logically belong together.
Substructures
Table YCUSTAB
.INCLUDE YSTRUC
4. Including Structures in Tables (Contd.)
March-2005 Adding Structures | 2.05 4
Table XYZ
.INCLUDE CI_XXX
Table T
.APPENDZAT
Append StructuresAppend Structures
Customizing Includes
Customer Tables SAP Tables
SAP Tables
Field 1
Field 2
...
Field n
Structure is a group of fields that logically belong together.
Substructures
Table YCUSTAB
.INCLUDE YSTRUC
5. Substructure
March-2005 Adding Structures | 2.05 5
YS-F1 YS-F2 YS-F3...
Table Field Data element
YT2 S1
(TRANSP) S2
F1
Table Field Data element
YT1 S1
(TRANSP) S2
F1
.INCLUDE YS
.INCLUDE YS
YS
6. Customizing Include
March-2005 Adding Structures | 2.05 6
CI_XXX
Table Field Data element
XYZ S1
F1
. . .
Fn
Table Field Data element
XYZ S1
F1
. . .
Fn
.INCLUDE CI_XXX
CI_XXX-F1 CI_XXX-F2 CI_XXX-F3
8. Demonstration
Creation of a substructure and adding the
same to one of the transparent tables created
in the previous exercises.
March-2005 Adding Structures | 2.05 8
9. Practice
Creation of a substructure and adding the
same to one of the transparent tables created
in the previous exercises.
March-2005 Adding Structures | 2.05 9
10. Summary
Structure is a group of internal fields that logically
belong together. A Structure consists of components
(fields) whose types are defined.
Substructures allow you to include fields from another
table or structure in the table you are creating.
Customizing includes are provided in SAP tables and
structures to allow you to add fields to these
structures/tables without modifying the tables
themselves.
Append structures allow you to add fields to SAP-
provided structures and transparent tables that were
not provided for in the standard version.
March-2005 Adding Structures | 2.05 10
11. Questions
What is a Structure ?
What is a Customizing Include ?
How is the Append Structure functionality
used ?
March-2005 Adding Structures | 2.05 11
Editor's Notes
Structure - A group of internal fields that logically belong together. A Structure consists of components (fields) whose types are defined.
In ABAP, you reference a Structure by its name. To access the individual fields within a Structure, you must specify the name of the Structure followed by the relevant field name.
A Structure’s components can have an elementary type, a structured type, a table type, or a reference type.
Structures are used especially to define the data at the interface of module pools and screens and to define the types of function module parameters.
Groups of fields can be added to customer tables using substructures.
Groups of fields or individual fields can be added to SAP delivered tables using append structures, or customizing includes:
Substructures allow you to include fields from another table or structure in the table you are creating.
Customizing includes are provided in SAP tables and structures to allow you to add fields to these structures/tables without modifying the tables themselves.
Append structures allow you to add fields to SAP-provided structures and transparent tables that were not provided for in the standard version.
Rather than listing all the fields you want a table or structure to contain, you can choose to include fields from another table or structure as a substructure. This allows you to avoid redundant field definitions in structures/tables as well as maintain changes for these common fields in one structure/table.
A structure can only be included in its entirety and must be of table type INTTAB or TRANSP.
Substructures can be nested. A structure can include another structure, which in turn includes another structure, etc.
Up to nine nesting levels are allowed.
TRANSP table types can only exist once in a nested chain.
To include a substructure in a table:
Type “.INCLUDE” for the Field Name field on the Table Change screen, then type in the name of the structure/table in the “Data elem.” field.
You can expand and collapse substructures in the table/structure definition screens they are used. This is an alternative way to see what fields the substructure holds, rather than double-clicking on the substructure name to navigate to its definition.
If it is expected customers will need to add their own fields to SAP tables or structures, some of the standard version SAP tables and structures are supplied with customizing includes.
Customizing includes are supplied empty by SAP and are filled in by the customer with the help of special customizing transactions. These includes make it possible to extend (add fields to) tables without modifying the tables themselves and without the risk of additions being overwritten during a Release Upgrade.
Names of customizing includes start with ‘CI_’. If a table does not contain a customizing include, you can still make additions by creating an Append structure. You cannot add your own ‘.INCLUDE CI_’ to an SAP table.
Append structures are intended for additions not provided for in the standard version of SAP tables via customizing includes. They are to be used with SAP transparent tables or structures, not with customer tables.
An Append structure is a structure assigned to exactly one table. However, a single table can have a number of append structures. It is recommended to use only one append structure in a table.
When an append structure is activated, its assigned table is also activated with all of the append structure fields. When a table including an append structure is activated, the append structure fields are found and added to the table.
Append structures cannot be deleted.
Append structures cannot be used with tables containing fields of data type VARC, LCHR, or LRAW because these data types must be the last field in a table.
Use the Append structures … push-button in the table display screen to add fields to SAP tables.
Fields contained in an Append structure are added to the SAP tables when an upgrade is performed and the appropriate tables are activated.