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

Difference between structure and view

Former Member
0 Likes
5,187

Hi,

Difference between structure and view ?

Regards,

Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,183

Hi Kumar,

Structure:

Structures globally define the data structure occurring in program calculations or when data is passed between programs.

Structures are used in particular to define the data at the interface of module pools and screens and to define the types of the parameters of reusable forms or function modules.

Structures are defined (almost) exactly like tables, but no database tables are generated from them. The same data elements and domains can be used in structures as in tables. Tables can also be included.

View:

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.

In the simplest case, this derivation process can involve simply suppressing the display of one or more fields from a table (projection) or transferring only certain records from a table to the view (selection). More complicated views can be assembled from several tables, with individual tables being linked using the relational join operation.

Logical views for the application permitting direct access to the data can be generated with the definition of view. The structure of such a view is defined by specifying the tables and fields involved in the view.

Best regards,

raam

12 REPLIES 12
Read only

Former Member
0 Likes
2,183

Hi,

Structure does not have any values stored in it like database tables. It is treated just like a work area.

View is created to join one or more tables (INNER JOIN only) and stores value when you refer to this view in your program. Even view does not have any values until runtime.

Regards,

Subramanian

Read only

0 Likes
2,183

Here are the Types of views

Database Views:

http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ecab446011d189700000e8322d00/content.htm

Projection View:

http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ecc5446011d189700000e8322d00/frameset.htm

Help Views:

http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ecd2446011d189700000e8322d00/frameset.htm

Maintenance Views:

http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ecdf446011d189700000e8322d00/frameset.htm

structure is basically single type view is 4 types...

structure holds data only in run time..view is nothihng but how u want to see the data in the data base..where it is categorized into 4 types..like combination of diff tables of data , single data view and help view as well

Reward points if useful

regards

sas

Read only

Former Member
0 Likes
2,184

Hi Kumar,

Structure:

Structures globally define the data structure occurring in program calculations or when data is passed between programs.

Structures are used in particular to define the data at the interface of module pools and screens and to define the types of the parameters of reusable forms or function modules.

Structures are defined (almost) exactly like tables, but no database tables are generated from them. The same data elements and domains can be used in structures as in tables. Tables can also be included.

View:

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.

In the simplest case, this derivation process can involve simply suppressing the display of one or more fields from a table (projection) or transferring only certain records from a table to the view (selection). More complicated views can be assembled from several tables, with individual tables being linked using the relational join operation.

Logical views for the application permitting direct access to the data can be generated with the definition of view. The structure of such a view is defined by specifying the tables and fields involved in the view.

Best regards,

raam

Read only

Former Member
0 Likes
2,183

Hi,

Chk out this link..

Regards.

Read only

Former Member
0 Likes
2,183

Hi Ganesh,

Views are logical views on more than one table. The structure of the view is defined in the ABAP Dictionary. A view on the database can then be created from this structure.

Four different view types are supported. These differ in the way in which the view is implemented and in the methods permitted for accessing the view data.

Database views are implemented with an equivalent view on the database.

Projection views are used to hide fields of a table (only projection).

Help views can be used as selection method in search helps.

Maintenance views permit you to maintain the data distributed on several tables for one application object at one time.

Structure of ABAP/4 program is ,

1. Declaration

Declaration statements which occur in procedures (methods, subroutines, function modules) form the declaration part for local data in those processing blocks. This data is only visible within the procedure in which it is declared.

2. Dialog Module(no local data area)

3. Event BlockEvent blocks (no local data area)

4. ProcedureProcedures (methods, subroutines and function modules with their own local data area).

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2d74358411d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ec5d446011d189700000e8322d00/content.htm

Regards,

Sravanthi

Edited by: Sravanthi Balabhadrapatruni on Jul 8, 2008 12:02 PM

Read only

Former Member
0 Likes
2,183

Hi,

STRUCTURE:

A structure is the logical template to a database table. it defines about the fields, corresponding data element and domain and doesn't contain any data.

VIEW

A view is a collection of all or selected fields of one or more database tables based on its definitation. they contain data at runtime.

Reward if found helpful.

Anirban Bhattacharjee

Read only

Former Member
0 Likes
2,183

Hi

For Structure :

http://help.sap.com/saphelp_nw04/helpdata/en/e3/92be7c6cd34fd485c967144e302fb6/content.htm

For Views :

http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ec5d446011d189700000e8322d00/content.htm

Diffrence between structure and view is that structures not contains any data while views contains data when it refers to program.

Rewards Points if usfeful.

Thanks & Regards

Nikunj Shah

Read only

0 Likes
2,183

Hi,

structure : it is created during runtime..and storage of data is temporary.

views : these are virtual tables which contains data from different tables.

Reward if useful.

Read only

Former Member
0 Likes
2,183

Hi Ganesh.

A structure is a group of internal fields that belong together logically.

But, a view is nothing but a view of fields of database table.

Virtual table that contains no data but is an application-specific view of one or more tables in the ABAP Dictionary

Virtual - means not actual, like pseudo.

A view has a structure which is defined by specifying the fields & tables used by that structure.

Reward points if you find this information usefull.

Regards

Harsh

Read only

Former Member
0 Likes
2,183

Structure : Structure is like your Internal table only with a difference that it have all the values at run time only. that means data it contains at run time only and not permanently.

Views : view you create to view data from different tables and different fields together.

say table1 have fields f1,f2,f3 and table2 have fields f4,f5.

you can create your view from SE11 to view f1,f2,f4,f5 fields together.

they are like views in RDBMS.

Read only

Former Member
0 Likes
2,183

Hi Ganesh,

VIEW: The view is derived from one or more tables which is created only with the required fields from the database table(s). It can also be created with table inner joins and specifying conditions for data retrieval.

regards,

pritam.

Read only

Former Member
0 Likes
2,183

structure gets data at runtime, it can not hold data.

view stores data in the data base.

views

Data about an application object is often distributed on several tables. By defining a view, you can define an application-dependent view that combines this data. The structure of such a view is defined by specifying the tables and fields used in the view. Fields that are not required can be hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data selection.

The data of a view is derived from one or more tables, but not stored physically. The simplest form of deriving data is to mask out one or more fields from a base table (projection) or to include only certain entries of a base table in the view (selection). More complicated views can comprise several base tables, the individual tables being linked with a relational join operation. See also Join, Projection and Selection.

The base tables of the view must be selected in the first step of a view definition. In the second step, these tables must be linked by defining the join conditions. It is also possible to use the join condition from a foreign key defined between the tables (see Foreign Key Relationship and Join Condition). In the third step, you must select the fields of the base tables to be used in the view. Selection conditions that restrict the records in the view can be formulated in the fourth step.

Four different view types are supported. These differ in the way in which the view is implemented and in the methods permitted for accessing the view data.

Database views are implemented with an equivalent view on the database.

Projection views are used to hide fields of a table (only projection).

Help views can be used as selection method in search helps.

Maintenance views permit you to maintain the data distributed on several tables for one application object at one time.

Database views implement an inner join. The other view types implement an outer join (see Inner and Outer Join).

The join conditions for database views can be formulated using equality relationships between any base fields. The join conditions for the other view types must be obtained from existing foreign keys. Tables therefore can only be combined in a maintenance view or help view if they are linked to one another with foreign keys.

The maintenance status defines whether you can only read data with the view or whether you can also insert and change data with it.

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.

The central definition of structures that are used more than once makes it possible for them to be changed centrally. The active ABAP Dictionary then makes this change wherever required. ABAP programs or screen templates that use a structure are automatically adjusted when the structure is changed (see Runtime Objects). This ensures the greatest possible consistency of the data definition, also for complex programs.

There are Flat, nested and deep structures. A flag structure only references elementary types. A nested structure references at least one further structure, but not a table type. A deep structure references at least one table type.

In a database table, you can only include flat structures as substructures.