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 -
Create Structure -
Step-1: Go to SE11 transaction.
It opens ABAP Dictionary: Initial Screen.
Step-2: Select Data type radio button and enter the Data type name. Click on Create button.
It opens Create Type dialog box. Select Structure radio button and click on Continue button.
It opens Dictionary: Change Structure screen.
Step-3: Enter the component name and select the component type from the component type list.
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.
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.
Step-6: Once the structure successfully saved message displayed, click on "active" button or "Ctrl +F3" to activate the structure like below.
Sometimes, while activating the structure the below warnings might display.
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.
This structure is not require to enhance. So we are selecting "Cannot Be Enhanced" on below screen and click on Copy.
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.
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.
It opens ABAP Dictionary: Initial Screen
Step-2: Enter the "Structure name" and click on the "Change" icon.
Step-3: Click on "Save" once the information modified. Verify the below message gets displayed on status bar.
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.
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.
It opens "ABAP Dictionary: Initial" Screen
Step-2: Enter the structure name and click on the "delete" icon.
It displays a "Delete Structure" popup for confirmation, click on "Yes" to delete the structure.
Once the structure successfully deleted, the below message displays on status bar.