SAP DDIC APPEND STRUCTURES



Get Example source ABAP code based on a different SAP table
  



ABAP_DDIC - Append Structures
An append structure is a structure in ABAP Dictionary appended to another DDIC structure or to a DDIC database table which adds its components to this structure or table. In customer systems, append structures can be added to DDIC structures and DDIC database tables delivered by SAP. An append structure is assigned to exactly one table or structure. There can, however, be more than one append structure for a table or structure. The components of append structures must meet the prerequisites for table fields.
The following extensions can be made to a DDIC database table or DDIC structure using an append structure:
New components can be inserted (if allowed by the enhancement category)
Foreign keys can be added to existing fields of a DDIC database table.
Search helps can be bound to existing components.
The append structure is a standalone object and changes to components of the append structure as well as transporting the append structure are made only using the append structure. When a DDIC database table or a DDIC structure is activated, all associated append structures are found and their components are appended to the DDIC database table or structure. Any foreign keys or search help bindings added by the append structure are also appended. When an append structure is activated, the assigned DDIC database table or DDIC structure is adjusted to the changes made. Any existing tables are not adjusted, which can put the fields in the dictionary in a different order from the order on the database. When a DDIC structure or DDIC database table with an append structure is copied, the appended fields, foreign keys, and search helps become real elements of the target of the copy.
The following must be noted when using append structures to extend DDIC database tables:
Append structures can only be appended to transparent tables.
No append structures can be appended to DDIC database tables with fields of the type LCHR or LRAW, since these fields must always be the last field of the table.
Any fields appended to a DDIC database table using an append structure can be added to its secondary indexes. No secondary index can be defined for the append structure itself.
A binding of a check table or search help that already exists for a field of the DDIC database table cannot be modified by an append structure.
Extensions of SAP structures or SAP tables using append structures in customer systems do not modify the original object. Append structures created for SAP objects in customer systems are in the customer namespace (or in the namespace of a partner of a special development project) and hence are protected from being overwritten by upgrades. It is advisable to also create the components of append structures with names from the customer namespace to avoid naming conflicts. After an upgrade, the append structures are again appended to tables modified by SAP.
Append structures can be defined as form-based structures in transaction SE11 or as source-code-based structures using Dictionary DDL in the ABAP Development Tools. The following section describes the syntax of the source code-based definition:
Dictionary DDL for Structure Extensions

ABAP_FURTHER_INFO
Rules for extending DDIC structures or DDIC database tables from a restricted ABAP language version by means of developer extensibility are described in section C0 Contract Rules for DDIC Objects.



Latest notes:

The same structure can be appended to multiple DDIC database tables or structures by including it in the individual append structures as an include structure.
ABAP_HINT_END



Example ABAP Coding

The append structure DEMO_APPEND_STRUCTURE extends the structure DEMO_STRUCTURE.
ABAP_EXAMPLE_END