Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Link to Content's target Space :

http://wiki.sdn.sap.com/wiki/display/ABAP/ABAP+Workbench

Applies to:

SAP ABAP/ SAP ECC (4.7) / SAP ECC (6.0).

Summary

This article contains the procedure of creation of view clusters using views and also explains some benefits of the view clusters.View cluster is a group of maintenance dialogs which are collected in maitenance unit.They allow data from one or more tables/views to be maintained successfully...

Author(s):  Nimisha Agarwal

   
Company:     Infosys Technologies Limited
Created on:    10th May 2010
Author(s) Bio
 Nimisha Agarwal is working with Infosys Technolofies Limited from last 1.5 years. She has got experience in various projects in SAP ABAP.


Table of Contents

Introduction
Prerequisites
Procedure
1)       Maintenance View for ZMEMPLOYEE
2)       Maintenance View for ZMEMPDETAILS
3)       Table Maintenance Generator for Z_EMPLOYEE
4)       Table Maintenance Generator for Z_EMPDETAILS
5)       This follows with creation of view cluster
Testing of View Cluster
Benefits of View Cluster
Related Content


Introduction

 A view cluster is a group of maintenance dialogs, which are collected in one maintenance unit for business or technical reasons. We can arrange the data in a hierarchical or non-hierarchical manner. A view cluster consists of different objects, which can be tables, views. They allow related data in more than one table/view to be maintained consistently through one business function and by maintaining foreign key relationship between the tables.
 
Transaction Codes:

Transaction code to create a view cluster: SE54

Transaction code to maintain the tables and views: SE11 

A view cluster can be created using two methods:
1)     Using table maintenance generator to maintain entries in the table.
2)     Using maintenance views to maintain entries in the table.
 
Here, we will discuss the creation of view clusters using maintenance views. Creation of view cluster can be explained with the help of an example, which has been mentioned below:

Let us create a view cluster on employee details.

 Prerequisites

The tables, which are being used, are ZMEMPLOYEE and ZMEMPDETAILS.

The screen shots of the above used tables are shown below:

ZMEMPLOYEE:

 


 


ZMEMPDETAILS:

 



 

Foreign key relationship has been maintained in the above tables.   

 Data Entries in ZMEMPLOYEE:

 




Data Entries in ZMEMPDETAILS:

* *


Procedure

1)     Maintenance View for ZMEMPLOYEE

As mentioned above, to create maintenance view, go to transaction SE11.

a)     Select the radio button 'View' and give the name as 'Z_EMPLOYEE'.

b)    Click on 'Create'.





c) From the mentioned options in pop up, select 'Maintenance view'.

 



 

d) Give the short description, enter the table name ZMEMPLOYEE and click on 'View Fields'.

 

 

e) All the key fields would be added by default. To add more fields from the table, click on the tab 'Table Fields' and select the desired fields, which are required.

 


 

 

 The next step is to save and activate the maintenance view Z_EMPLOYEE.

1)     Maintenance View for ZMEMPDETAILS

       To create the maintenance view of ZMEMPDETAILS, the same above procedure is followed.

a)     In the view Z_EMPDETAILS, in the 'P' column of the 'View Fields', enter 'S' for the fields of ZMEMPLOYEE, which we want to appear as subsets in the view cluster. This is because the values for ZMEMPLOYEE would be filled in its view itself. These values will appear as header data in the item details of the view cluster.

 

Now, Save and activate the view Z_EMPDETAILS.

1)     Table Maintenance Generator for Z_EMPLOYEE.

a) Now, for each view we have to maintain a table maintenance generator so as to maintain the view entries.

The process is as follows:

 

 

b) The Table Maintenance screen appears as follows:

 
 

c)     Now, first create a function group say ZFG_EMPLOYEE from transaction SE80. After the creation of function group, enter its name in option 'Function group'.

Maintenance type would be 'one step' and value of overview screen would be '1' because this screen would appear as header data i.e. first screen on view cluster which would be followed by the view Z_EMPDETAILS.

d)    Click on the button 'Create'.

 

 

1)     Table Maintenance Generator for Z_EMPDETAILS.

Follow the same procedure to create the table maintenance generator for Z_EMPDETAILS.

The value of overview screen would be '2' for this view because this would appear as item level details i.e. second screen in the view cluster.

 

 

1)     This follows with creation of view cluster

The pre-requisites for creating a view cluster are now ready.

a)     The transaction code to create a view cluster is SE54.

b)    Click on 'Edit View Cluster' tab and give the name for view cluster say 'ZVC_EMPLOYEE' and then click on 'Create'.

 

 

c)     A pop up would appear containing an information message saying:

 
 

d)  Click on 'Enter'. The next screen would appear as follows. Give a short description and click on 'Object Structure'.

 

 

e)     After clicking the 'Object Structure', the next screen would appear as follows. Now click on 'New Entries' to enter the maintenance views created to form the view cluster.

 
 

f)      After clicking on 'New Entries', enter the values in given columns as follows:

 
 

g)     These entries would be entered in hierarchical manner i.e. details of first view would be filled first and then details of second view.

h)     The short text is the description of the view i.e. Header details and item details. The 'Predecess' column specifies the predecessor of the view. The predecessor of the first view Z_EMPLOYEE is Z_EMPLOYEE itself and the predecessor of second view Z_EMPDETAILS is Z_EMPLOYEE.

i)      The 'DEP' column of the view cluster explains the details of entry. It could be a header entry or dependent entry. The value for Z_EMPLOYEE would be 'R', because it does not depend on any other view, therefore, it is a header entry. The value for Z_EMPDETAILS would be 'S' because it is dependent on the first view i.e. Z_EMPLOYEE.

j)      The 'POS' column explains the sequence of the views.

k)     Lastly 'Start' explains the first view in hierarchy, which is in Z_EMPLOYEE in this case.

l)      After entering the above entries, press 'Enter'.

The two pop-ups would appear as follows:

 

 

m)    Now select each line and click on 'Field Dependence' button.

A pop-up appears saying 'Field dependence successfully generated'.

 
                    


   Repeat the same for Z_EMPDETAILS.

n)    Save the view cluster. Click on 'Header Entry' and then click on tab 'Activate'. A pop up would appear. Click on 'Yes'.

 
 

o)     The following screen appears. Click on 'Enter'.

 

 

The View Cluster has been created successfully.

Testing of View Cluster

a)     Go to transaction SE54 and click on tab 'Edit View Cluster'.

b)    Give the name of view cluster 'ZVC_EMPLOYEE' and click on 'Test'.

 

 

c) In the first screen, all the existing entries of the table ZMEMPLOYEE would appear. To see the corresponding item details of a particular employee, select an entry from the view and click on 'Item Details'.

 

 

d)     The Item Details of the particular employee would be displayed.

 


The value selected from the first view would appear as header entry since they have been selected as subsets in the creation of the second view Z_EMPDETAILS.

View Cluster has been tested successfully since; it is displaying the correct item details of the particular selected employee as mentioned in the beginning of the document.

Benefits of View Cluster

1)     It is easy to maintain data in view clusters because it provides a convenient way of navigation between the maintenance dialogs.

For example: User can maintain data in hierarchical manner and hence it is easy to navigate between the header details and item details. 
2)     View clusters ensure consistency of the data stored in the tables i.e. copying, deleting, adding and saving the data.

For example: If the user wants to delete all the entries of a particular group. It can be deleted by deleting the group itself.

 So it would be easy for the user to maintain the data in a consistent manner.

3)     N: M relationship can be processed in view clusters. Maintenance dialogs which doesn't have any key or have partial key dependency can also be combined into the view clusters. 

Related Content

http://help.sap.com/saphelp_nw04s/helpdata/EN/d0/999246b2aa11d1a5700000e82deaaa/content.htm 
http://wiki.sdn.sap.com/wiki/display/ABAP/Creation+of+View+Cluster 
http://wiki.sdn.sap.com/wiki/display/WHP/Home 

2 Comments

  1. Guest

    HI,

    i have doubt in views.I have used position replaces ,I have again change not applicable.They shows view doesn't exist.how can i solve.

    Thanks & best gegards

    murali

  2. Can you tell me how can I delete view clusters?