Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

view vs structure

Former Member
0 Likes
1,594

hi,

what is similarity and difference between view and structure?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,362

Hi,

The view of a database table is used to simulate the original database table. The view also contains the data which is present in the database table.

Whereas, a structure consist of only the fields which are present in a database table. It cannot be used to store data.

Reward if helpful.

Regards.

7 REPLIES 7
Read only

Former Member
0 Likes
1,362

hi,

Why we need views.

Data for an application object is often distributed on several database tables. Database systems

therefore provide you with a way of defining application-specific views on data in several tables. These

are called views.

Data from several tables can be combined in a meaningful way using a view (join). You can also hide

information that is of no interest to you (projection) or only display those data records that satisfy certain

conditions (selection).

The data of a view can be displayed exactly like the data of a table in the extended table maintenance.

A database view is defined in the ABAP Dictionary and automatically created on the database during

activation. Accesses to a database view are passed directly to the database from the database interface.

The database software performs the data selection.

If the definition of a database view is changed in the ABAP Dictionary, the view created on the database

must be adjusted to this change. Since a view does not contain any data, this adjustment is made by

deleting the old view definition and creating the view again in the ABAP Dictionary with its new definition.

The maintenance status defines whether you can only read with the view or whether you can also write

with it. If a database view was defined with more than one table, this view must be read only.

The data read with a database view can be buffered. View data is buffered analogously to tables. The

technical settings of a database view control whether the view data may be buffered and how this should

be done. The same settings (buffering types) can be used here as for table buffering. The buffered view

data is invalidated when the data in one of the base tables of the view changes.

You can include entire tables in database views. In this case all the fields of the included table become

fields of the view (whereby you can explicitly exclude certain fields). If new fields are included in the table

or existing fields are deleted, the view is automatically adjusted to this change. A new or deleted field is

therefore automatically included in the view or deleted from it.

Database views implement an inner join. You only get those records which have an entry in all the tables

included in the view.

Maintenance views implement an outer join.

-


There are three different type categories in the ABAP Dictionary:

Data elements: Describe an elementary type by defining the data type, length and possibly decimal

places.

Structures: Consist of components that can have any type.

Table types: Describe the structure of an internal table.

Any complex user-defined type can be built from these basic types.

You can also create a structured type in the ABAP Dictionary for which there is no corresponding object

in the database. Such types are called structures. Structures can also be used to define the types of

variables.

Structures can be included in tables or other structures to avoid redundant structure definitions.

A table may only be included as an entire table.

A chain of includes may only contain one database table. The table in which you are including belongs to

the include chain. This means that you may not include a transparent table in a transparent table.

Includes may contain further includes.

Foreign key definitions are generally imparted from the include to the including table. The attributes of

the foreign key definition are passed from the include to the including table so that the foreign key

depends on the definition in the include.

Hope this is helpful, Do reward.

Edited by: Runal Singh on Feb 6, 2008 3:31 PM

Read only

Former Member
0 Likes
1,362

Hello Manoj,

Using tables you can get that table contents only. but you can restrict the number of fields for display.

But Using views you can get the data from different tables and there you can join them using foriegn key relationship and conditions.

Simply you can say that: Views are similar like getting data from select query using innerjoin operation. But using select query we will get data at program level. Using Views you will get the data at data dictionary level.

Reward If Helpful.

Regards

--

Sasidhar Reddy Matli.

Read only

Former Member
0 Likes
1,363

Hi,

The view of a database table is used to simulate the original database table. The view also contains the data which is present in the database table.

Whereas, a structure consist of only the fields which are present in a database table. It cannot be used to store data.

Reward if helpful.

Regards.

Read only

Former Member
0 Likes
1,362

a structre doesnt consists data.

a view is used to combined two tables , so that the retriving data is easy.

Read only

Vijay
Active Contributor
0 Likes
1,362

hi

The followings are different types of views:

Database View (SE11)

Database views are implement an inner join, that is, only records of the primary table (selected via the join operation) for which the corresponding records of the secondary tables also exist are fetched. Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set.

In database views, the join conditions can be formulated using equality relationships between any base fields. In the other types of view, they must be taken from existing foreign keys. That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys.

Help View ( SE54)

Help views are used to output additional information when the online help system is called.

When the F4 button is pressed for a screen field, a check is first made on whether a matchcode is defined for this field. If this is not the case, the help view is displayed in which the check table of the field is the primary table. Thus, for each table no more than one help view can be created, that is, a table can only be primary table in at most one help view.

Projection View

Projection views are used to suppress or mask certain fields in a table (projection), thus minimizing the number of interfaces. This means that only the data that is actually required is exchanged when the database is accessed.

A projection view can draw upon only one table. Selection conditions cannot be specified for projection views.

Maintenance View ( SE54 )

Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system.

Please have a look at below link. It will help you.

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed06446011d189700000e8322d00/frameset.htm

for more detailed info look on:

http://www.sap-img.com/abap/what-is-the-different-types-and-usage-of-views.htm

&

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap+dictionary&;

structures

A structure (structured type) comprises components (fields). Types are defined for the components A component can refer to an elementary type (via a data element or by directly specifying the data type and length in the structure definition), another structure or a table type. A structure can therefore be nested to any depth.

Structures are used to define the data at the interface of module pools and screens and to define the parameter types of function modules.

The data for managing the addresses of persons can be represented as a nested structure PERSON. The structure comprises the components (structures) NAME and ADDRESS. The structure NAME comprises the components (data elements) FIRSTNAME and LASTNAME. The structure ADDRESS comprises the components (structures) STREET and TOWN. The structure STREET comprises the components (data elements) STREETNAME and HOUSENO. The structure TOWN comprises the components (data elements) ZIP and TOWNNAME.

regards

vijay

reward points if helpful

Read only

Former Member
0 Likes
1,362

Hi

Data for an application object is often distributed on several database tables. Database systems therefore provide you with a way of defining application-specific views on the data contained in several tables. These are called views.

Data from several tables can be combined in a meaningful way using a view (join). You can also hide information that is of no interest to you (projection) or only display those data records that satisfy certain conditions (selection).

A view is a logical view on one or more tables, that is, a view is not actually physically stored, instead being derived from one or more other tables.

The data of a view can be displayed exactly like the data of a table in the extended table maintenance.

Structures: Consist of components that can have any type.

Structured types describe the structure and functions of any structured data objects, that is of data structures with components of any type. A component can be a field with an elementary type or can itself be a structure. A table can also be used as a component in a structure. A database table always has a structure and is therefore implicitly a structured type. However, the fields of a database table can only have an elementary type.

Read only

Former Member
0 Likes
1,362

mnj