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

Create Structure -

Step-1: Go to SE11 transaction.

Create Structure

It opens ABAP Dictionary: Initial Screen.

Create Structure

Step-2: Select Data type radio button and enter the Data type name. Click on Create button.

Create Structure

It opens Create Type dialog box. Select Structure radio button and click on Continue button.

Create Structure

It opens Dictionary: Change Structure screen.

Create Structure

Step-3: Enter the component name and select the component type from the component type list.

Create Structure

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

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

Step-6: Once the structure successfully saved message displayed, click on "active" button or "Ctrl +F3" to activate the structure like below.

Create Structure

Note! At this point it displays all inactive structure list if any other inactive structures exists. Select the appropriate structure that needs to activate.

Sometimes, while activating the structure the below warnings might display.

Create Structure

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

This structure is not require to enhance. So we are selecting "Cannot Be Enhanced" on below screen and click on Copy.

Create Structure

Note! The "Cannot Be Enhanced" option is only if the structure is not enhanced in future. If the structure may need enhancement in future, select appropriate option form the list.

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

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

It opens ABAP Dictionary: Initial Screen

Change Structure

Step-2: Enter the "Structure name" and click on the "Change" icon.

Change Structure

Step-3: Click on "Save" once the information modified. Verify the below message gets displayed on status bar.

Change Structure

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

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

It opens "ABAP Dictionary: Initial" Screen

Delete Structure

Step-2: Enter the structure name and click on the "delete" icon.

Delete Structure

It displays a "Delete Structure" popup for confirmation, click on "Yes" to delete the structure.

Delete Structure

Once the structure successfully deleted, the below message displays on status bar.

Delete Structure