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.
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.
1. Go to transaction SE11 -> select radio button 'View' -> enter the name of the view -> press 'Create'.
2. Below pop up screen will be displayed. Select 'Database View' and press button.
3. Below screen gets displayed, enter suitable short description and Tables VBAK and VBRK.
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'.
7. Select the Tables and click on choose button
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
Now you can see the selected fields .
8. Now select the table fields for vbrk table and copy the required fields
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'.
10. We repeat the above step to include below shown fields from table View tables.You can see the selected fields.
11. W e can display the view based on the selection conditions if you required.
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
13. Now it will display the below input screen,just click on execute button.
14. You can see the detailed output with table entries from the view tables.
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'.
2. Below pop up screen will be displayed. Select 'Database View' and press button.
3. Below screen gets displayed, enter suitable short description and Tables VBAK and VBRK.
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'.
7. Select the Tables and click on choose button
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
Now you can see the selected fields .
8. Now select the table fields for vbrk table and copy the required fields
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'.
10. We repeat the above step to include below shown fields from table View tables.You can see the selected fields.
11. W e can display the view based on the selection conditions if you required.
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
13. Now it will display the below input screen,just click on execute button.
14. You can see the detailed output with table entries from the view tables.