Creating Data Base View in SAP ABAP

Views
Data about an application object is often distributed on several tables. By defining a view, you can define an application-dependent view that combines this data. The structure of such a view is defined by specifying the tables and fields used in the view. Fields that are not required can be hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data selection.

How to create SAP ABAP Database View

Database views are implemented with an equivalent view on the database.
Projection views are used to hide fields of a table (only projection).
Help views can be used as selection method in search helps.
Maintenance views permit you to maintain the data distributed on several tables for one application object at one time.

Steps to create a database view

1.Create the database view in se11.
2.select the tables .
3.create the relationship between tables.
4.Create the table fields for view tables.
5.Save and activate the view and see the content.

1.     Go to transaction SE11 -> select radio button 'View' -> enter the name of the view -> press 'Create'.

 
Creating Data Base View in SAP ABAP

2.     Below pop up screen will be displayed. Select 'Database View' and press   button.

 
Creating Data Base View in SAP ABAP

3.     Below screen gets displayed, enter suitable short description and Tables VBAK and VBRK.
Creating Data Base View in SAP ABAP

 


5.     Next, we need to link the entered tables by specifying the fields in join condition. We can also derive the join conditions from existing foreign keys between the base tables of the view. To do this, position the cursor on the table names and click on  Relationships Button  present at the bottom.
6.     Below pop up comes wherein linked tables are present. Select the tables and press 'Copy'.


Creating Data Base View in SAP ABAP
7.     Select the Tables and click on choose button

Creating Data Base View in SAP ABAP

Now ,click the View fields button to derive the fields from View tables and select the table and click on Table fields button and choose the required fields
Creating Data Base View in SAP ABAP

 


Now you can see the selected fields .

Creating Data Base View in SAP ABAP

8.    Now select the table fields for vbrk table and copy the required fields
Creating Data Base View in SAP ABAP

 9.     On pressing 'Table fields' button we get a popup likewise shown below. Choose the table whose fields we want to include in our view. Another popup will be shown select the fields we want to include and press 'Copy'.

Creating Data Base View in SAP ABAP


10.  We repeat the above step to include below shown fields from table View tables.You can see the selected fields.


Creating Data Base View in SAP ABAP

11.  W e can display the view based on the selection conditions if you required.
Creating Data Base View in SAP ABAP

12.  Finally we got the below fields from the two different tables in our database view.  Now ,save and activate the view. click on the content button


Creating Data Base View in SAP ABAP


13.   Now it will display the below input screen,just click on execute button.
Creating Data Base View in SAP ABAP


14.  You can see the detailed output with table entries from the view tables.
Creating Data Base View in SAP ABAP

 


Popular posts from this blog

How to create Interactive Report in SAP ABAP

How to create ALV Interactive Report in SAP ABAP

BDC Call Transaction Method Program