Summary -
In this topic, we described about the below sections -
What is Structure?
Structure is a group of components defined under a name. A component is a field that can be an elementary type or another structure or table.
The group ofcomponents defined under structure can be of any data type that are stored one after the other in the memory in the same order how they defined. Structure can be nested to any depth.
Structures are two types based on how they have used and those are -
- Local Structures - Structures created in the ABAP programs that are local to the program.
- Global Structures - Structures created in ABAP dictionary that are globally available to all the programs.
Structured are three types based on how they created and those are -
- Flat Structure - Defines with only elementary types.
- Nested Structure - Defines with elementary types along with another structure.
- Deep Structure - Defines with table type along with elementary types.
Let us take an example of Customer details and discuss how the structure of customer details -
![Customer Details Structure](img/structures.png)
Create Structure -
Step-1: Go to SE11 transaction.
![Create Structure](img/structures1.png)
It opens ABAP Dictionary: Initial Screen.
![Create Structure](img/structures2.png)
Step-2: Select Data type radio button and enter the Data type name. Click on Create button.
![Create Structure](img/structures3.png)
It opens Create Type dialog box. Select Structure radio button and click on Continue button.
![Create Structure](img/structures4.png)
It opens Dictionary: Change Structure screen.
![Create Structure](img/structures5.png)
Step-3: Enter the component name and select the component type from the component type list.
![Create Structure](img/structures6.png)
Step-4: Press (Ctrl + S) or "Save" icon to save the Structure. System asks for the package. Enter existing package if any, or create new package.
![Create Structure](img/structures7.png)
Once the package information entered, click on "Local object" (if it is a local structure and non transportable object) or "Save" to create the structure.
Step-5: Once the structure saved successfully, the "ZTC_CUTOMER saved" message displayed on status bar.
![Create Structure](img/structures8.png)
Step-6: Once the structure successfully saved message displayed, click on "active" button or "Ctrl +F3" to activate the structure like below.
![Create Structure](img/structures9.png)
Sometimes, while activating the structure the below warnings might display.
![Create Structure](img/structures10.png)
These are enhancement related warning messages that requires to specify the structure enhancement category. To resolve the above warnings, go to "Extras -> Enhancement Category..", that opens the below information dialog box. Click on "Continue" icon.
![Create Structure](img/structures11.png)
This structure is not require to enhance. So we are selecting "Cannot Be Enhanced" on below screen and click on Copy.
![Create Structure](img/structures12.png)
Step-7: Click on "Activate" icon or "Ctrl +F3" to activate structure. If the structure activated successfully, the "Object" message displayed on status bar like below.
![Create Structure](img/structures13.png)
Now, structure got activated and available for all programs. If error messages or warnings occurred during the activation of the structure, the activation log gets displayed automatically. The same activation log can navigate through menu option Utilities(M) → Activation log.
Change Structure -
If any information in the structure updated wrongly, structure needs to be changed. Change Structure option is used to change the structure properties and follow the below steps to change structure.
Step-1: Go to SE11 transaction.
![Change Structure](img/structures1.png)
It opens ABAP Dictionary: Initial Screen
![Change Structure](img/structures2.png)
Step-2: Enter the "Structure name" and click on the "Change" icon.
![Change Structure](img/structures3.png)
Step-3: Click on "Save" once the information modified. Verify the below message gets displayed on status bar.
![Change Structure](img/structures8.png)
Step-4: Click on "Activate" icon or "Ctrl +F3" to activate the new changes of the structure. Verify the below message gets displayed on status bar.
![Change Structure](img/structures13.png)
Delete Structure -
If we want to delete the existing structure or a structure is wrongly created, follow the below steps to delete structure.
Step-1: Go to "SE11" transaction.
![Delete Structure](img/structures1.png)
It opens "ABAP Dictionary: Initial" Screen
![Delete Structure](img/structures2.png)
Step-2: Enter the structure name and click on the "delete" icon.
![Delete Structure](img/structures14.png)
It displays a "Delete Structure" popup for confirmation, click on "Yes" to delete the structure.
![Delete Structure](img/structures15.png)
Once the structure successfully deleted, the below message displays on status bar.
![Delete Structure](img/structures16.png)