Search This Blog

Monday, February 22, 2010

Projection View

A view doesn't contain any data physically. It's only a logical way of grouping the required fields from one/more tables with required Joins and selection conditions. View gets records from respective database tables only in runtime and if any updates are done using the View, the data will be actually saved/modified in the database tables. If we try to create any new records using Views, all fields of the database tables which don't lie in the view are maintained either as Blank or Zero(depending on the data type).

Projection View can be created on One table. We can insert records into the actual database table using these Views. The main use of Projection View lies in giving the feasibility of projecting only the required fields out of the number of fields of the table, without all the fields literally in the program, making our programming easier. (for ex: create a Projection View with 30 fields out of 128 fields of VBAK table).

Navigations to create a Database view for.

SE11 -> Select "VIEW" -> Name the view ( ZPROJVIEW1 ) -> Click on Create -> Opens an interface , select view type as "Projection View" -> click on Continue -> Opens an interface -> Enter Description for the projection view ( any ) -> Name the table to be assigned for the View ( VBAK ) -> Press Enter -> Click on Table Fields to select the List of Fields from table ( here select all key fields and optional required fields ) -> select required fields and click on copy -> Click on Maintenance status tab button -> select Access as "read and change" -> Save -> Activate..


 

* use the view in SE38 to fetch data into Reports.

REPORT ZVIEWTEST2 LINE-SIZE 150 NO STANDARD PAGE HEADING.

DATA : ITAB LIKE ZPROJVIEW1 OCCURS 0 WITH HEADER LINE.

SELECT * FROM ZPROJVIEW1 INTO TABLE ITAB.

LOOP AT ITAB.

WRITE : / ITAB-VBELN , ITAB-KUNNR , ITAB-NETWR , ITAB-AUDAT , ITAB-VBTYP.

ENDLOOP.

3 comments:

  1. Thanks Very much.. it is very helpful, simple and precise Description of projection views.

    ReplyDelete
    Replies
    1. Looking for the best SAP ARIBA Training in Bangalore, then don't delay join IntelliMindz SAP ARIBA Training in Bangalore. Join our SAP ARIBA training to get hands-on training and practice in SAP ARIBA Software. Any Queries call @ 9655877677. IntelliMindz is the best IT Training Institute in Bangalore with placement, offering 200 and more software courses with 100% Placement Assistance.
      SAP ARIBA in Bangalore
      SAP ARIBA in Chennai
      SAP ARIBA Online Course

      Delete
  2. Projection view is for maintain the data, but here how we can maintain the data.

    ReplyDelete