Saturday, March 10, 2018

Views in SAP ABAP - Database View

View : A view acts just like a normal table only , but it will not occupy storage space in database layer. We can say that view is nothing but a virtual table (Physically not available but logically available).

View Types :

1. Database View
2.Projection View
3. Maintenance View
4.Help View


Database View :
--------------------

A Database view is used to join two or more basis tables. We can create Database view with single basis table also but it does not make any sense , in that case we can go for Projection View.

If they are multiple basis tables, they are joined using Inner Join.A matching SQL view will get create in DB Layer when we activate our view.

View Creation is just like Table creation only .

GOTO --> SE11

Select View radio Button --> Provide View name --> Select the View Type from POPUP

Important Points to remember : 
------------------------------------

1. We can use a basis table ( a transparent table) which is not active in DDIC for View Creation.

2 . If you didn't specify any join condition , then FullJoin will applied automatically.

3.If the database contains only one basis table , then you can change DB Table data using view.

For Ex : View name : ZNKP_DBVIEW.
              workaraea :  WA_VIEW refer to view .
             DB table : ZPLAYER.
         
             Modify ZNKP_DBVIEW from WA_VIEW.

ZPLAYER contents will get modified.


4.it's mandatory to maintain all key fields in View creation if you want use READ & CHANGE maintenance status . (This maintenance status will allow for single table only)

5.If you are using multiple tables , View is write protected.