Sunday, 1 May 2011

VIEWS


VIEWS

view creation:   view is logical table and it maintain the data at runtime only.

§                     If u look into previous class, created database tables i.e:1) ydept(fields are dno & dname) this table is for dept details, 2) yempk(emp details) fields are eno, dno, ename.
§                     Based on these two tables provide a definition for VIEWS
§                     Ydept + yempk = views
§                     Here views contains i.e. yviews (fields are dno, eno, dname)
§                     View is a virtual table
§                     Working with prog part, I can apply SQL statement i.e.: select * from yviewk
§                     View maintains the data on run time only
Once execute program its puts impact






ENO
DNO
E Name









d.no
Dname



 

Dno
Eno
Dname




 

Eno
D name
Ename







 








 
                                 
                                  +                                    =
                                                                                                                                                                                    










            view demo:



                           
§   go to ABAP Dictionary.
§   select  view and provide view name YJVIEW.
§   go for create.
§   select database view[because we are using database tables based on database view]
§   provide short text :DEMO
§   provide tables which we are using for view creation i.e. YJEMP                                                         YJDEPT        
§   provide Joined condition Relation by selecting Joined

YJEMP                     ENO                          = YJDEPT          ENO
§   Go with view fields
§   Provide the fields from above view table [diagram]

   ENO                                 YJEMP                      ENO                                                                                                                       DNO       YJDEPT DNO                                                                                                                                                                            ENAME     YJEMP   ENAME                    

§   ctrl+s  development class
§   ctrl+f3   local object
§   For execution: go with Utilities from menu under
§   Utilities select contents
§   press f8 for execute
§   It will show the records from both tables what we selected
§   advantage of view is performance


No comments:

Post a Comment