Hi, I provide training in SAP UI5. Also feel free to checkout my new web page https://saptechblog.com

Database view


Data about an application objects are often distributed on the several database tables. Say, for example the purchase order details are distributed in tables like EKKO, EKPO and so on.


Database view provides the application specific view on such distributed data in a single view.


Application programs can access the data of a database view using the database interface. You can access the data in ABAP programs with both OPEN SQL and NATIVE SQL. However, the data is actually selected in the database. Since the join operation is executed in the database in this case, you can minimize the number of database accesses in this way. Database views implement an inner join.








Note: With database view we can only view the data and cannot modify the data.


Step1: Go to the Tcode SE11 and enter the name of the view you want to create and click on create (F5).





Step 2: Choose the type of view you wanted to create.





Step 3: Enter the short description for the view





Then provide the list of tables for which you wanted to create a view.


Keep in mind that you can only include transparent tables in a database view.


Here I am going to create a database view to see the combined data of the table EKKO and EKPO.


If there are suitable foreign keys between the tables, you should copy the join conditions from these foreign keys


Click on the relationship the system will propose you the relationships between these tables.


Choose the relationship between the tables and press COPY.




The system will generate the join conditions.




Step 4: In the view fields tab select the fields that you want to copy to the view which you can also choose from the table fields.




After clicking on the table field choose the table from where you want to select the fields.



Select the fields in the table and press copy.






Similarly add some fields from the EKPO Table.





Step 5: In the selection condition specify the condition for which you want the view to display the data.




Step 6: In the Maintain status tab, set the maintenance status.




Save and activate the application.


Go to -> Technical settings and maintain the setting you want. The technical settings control whether the view should be buffered or not.


Step 7: View the contents using ctrl+shft+f10 or clip_image030





Execute to see the output.






Records will be displayed for the selected fields from the EKKO and EKPO table and for the conditions which we have written.



About Arun


Powered by Blogger.