Site icon DataFlair

SAP ABAP Structures and Views

SAP ABAP Structures and Views

FREE Online Courses: Knowledge Awaits – Click for Free Access!

In this tutorial, we’ll be learning about two important components of the SAP ABAP system. These are ABAP Structures and ABAP Views.

What are Structures in SAP ABAP?

How to create structure in ABAP?

Here are the steps to create a structure in ABAP beginning with the Data Dictionary –

1. Open the SAP system.

2. Enter transaction code ‘SE11’ in top left.

3. Select ‘Data type’ option radio button.

4. Enter a suitable name for the structure (again, beginning with ‘Z’ or ‘Y’) and click on the ‘Create’ button to proceed.

5. Now, select the option ‘Structure’ and hit enter. This opens a popup window of ‘Maintain/Change Structure’.

Technology is evolving rapidly!
Stay updated with DataFlair on WhatsApp!!

6. Enter a ‘Short Description’ of what the structure is about, in your own words for reference.

7. Type in the Component and Component type (which is basically a combination of the two things that make up a structure – field name & data element)

8. We have created the structure now. You can save it and use it as per the requirement.

In a program, we can use ‘BEGIN OF..’ and ‘END OF..’ additions to the statements ‘DATA’, ‘TYPES’ and so on. As in ABAP, we define Structures as data types hence we can code them this way.

What is a View in SAP ABAP?

Joins in ABAP

As mentioned previously, we use joins to create views from more than one database table.

We use the common key between the tables as an anchor point from which to compare records and merge corresponding one from either table.

Types of Join in SAP ABAP

Here are the types of joins in SAP ABAP –

1. Inner Join in ABAP

2. Outer join in SAP ABAP

How to create a view in ABAP

Here are the steps to create view in SAP ABAP –

1. Open the SAP system.

2. Enter transaction code ‘SE11’ in top left.

3. Select the ‘Views’ option radio button.

4. Enter a suitable name for the view (again, beginning with ‘Z’ or ‘Y’) and click on the ‘Create’ button to proceed.

 

5. Enter a ‘Short Description’ of the view for further purposes.

6. Select button called ‘Table fields’ which opens the field selection screen for table 1. Use check options to include whichever fields you want in the view.

 

7. Follow the same steps for table 2 and save.

8. In the popup window of ‘Maintain/Change View’ use option ‘Display/Maintenance Allowed’.

9. Save and activate view.

Types of views in ABAP

There are various types of views available in ABAP. They are as follows –

1. Database view in ABAP

2. Projection view in ABAP

3. Maintenance view in ABAP

4. Help view in ABAP

Summary

In this tutorial, we learnt about structures and views. We learnt their purpose, their functions, their types and how to create structures and views in ABAP.

Exit mobile version