Application Development 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: 

Database view use

Former Member
0 Kudos

Hi Experts

In what case we use the Database view in our programming.

How to know a particular database view has been used for a program.

Pls explain me on this.

Thanks in advance.

Regards

Rajaram

1 ACCEPTED SOLUTION

Former Member
0 Kudos

what case we use the Database view in our programming.

ans join more than 4 table.

also used for maintain data manually.

Creating a Database View

Enter the name of the view in the initial screen of the ABAP/4 Dictionary, select object class Views and choose Create. A dialog box appears, in which you must choose the type of the view. Select the type Database view.

The maintenance screen for database views appears. You will see three input areas for tables, join conditions and view fields. Carry out the following actions:

Enter a short explanatory text in the field Short text.

In Tables, enter the base tables which you want to include in the view.

Link the included tables with join conditions. Enter the fields which you want to identify in Join conditions.

You can also derive the join conditions from existing foreign keys between the base tables of the view. To do this, position the cursor on the table names and click on Relationships. All foreign keys to other tables defined for this table are displayed. If you only want too see the existing foreign key relationship between two of the tables included in the view, you must select these two tables (click on the tables in the first column of the input area).

Select the foreign key and choose Copy. The join condition is now derived from the definitions in the foreign key (see Foreign Key Relationship and Join Condition).

Select the fields which you want to include in the view.

You can enter the field names directly. If you do not know the field names, you can also copy them from the tables. To do this, position the cursor on a table and click on TabFields. The fields of the table are now displayed in a dialog box. You can copy fields from this by marking the first column and clicking on Copy.

You can also completely include a table in the view. The view then adapts itself automatically to changes in this table. If fields are inserted or deleted in the included table, these fields are automatically inserted or deleted in the view.

In order to include one of the tables in the view, you must enter * in the field Viewfield *, the name of the table to be included in the field Table and * in the field Fieldname. You can also exclude individual fields of an included table. If you do not want to include a field of the included table in the view, you must specify a - in the field Viewfield, the name of the included table in the field Table and the name of the field in the field Fieldname.

Formulate the selection conditions. To do this, choose Goto ® Selection condition. The input area for the selection conditions appears in place of the input areas for the fields. Maintain the selection conditions as described in Maintaining the Selection Condition for a View. You can then switch back to the fields display with Goto ® View fields.

Maintain the technical settings of the view. You can define whether or how the view should be buffered. When maintaining, proceed as for the technical settings of a table (see Maintaining Technical Settings). Note that only the settings for buffering can be maintained for views.

Save your entries. You are requested to assign the view a development class. You can change this development class later with Extras ® Object catalog entry.

Activate the view with View ® Activate. A log is written during activation. You can display this with Utilities ® Activation log. Errors or warnings which occur when the view is activated are displayed directly in the activation log.

When a database view is activated, the corresponding view is also automatically created on the database if the base tables of the view are already created there. If the base tables are not yet created on the database, this is recorded in the activation log. The view is nevertheless activated in the ABAP Dictionary. In this case you can create the relevant database view later with the database utility.

Create documentation about the view with Goto ® Documentation. This documentation is output for example when you print the view with View ® Print.

Optional Settings

You can make the following optional settings:

Change data element of a view field:

Select the Mod column (modify) and choose Enter. The Data element field is now ready for input. Enter the new data element there. This data element must refer to the same domain as the original data element. With the F4 help key for the Data element field, you can display all the data elements which refer to the domain of the field. If you want to assign the original data element again, it is sufficient to reset the Mod flag and choose Enter again.

Change maintenance status:

The maintenance status determines how you can access the view data from ABAP programs (read only, read and change). Choose Extras ® Maintenance status. A dialog box appears, in which you can select the maintenance status for the view. If more than one table is involved in the view, the maintenance status read only cannot be altered.

Display view data:

You can determine which data can be selected using the view with Utilities ® Display data.

Display create statement:

With Extras ® CREATE instruction you can display how the view was created on the database. The statement which was executed when the version of the view currently being edited was created in the database is displayed.

Check functions:

With Extras ® Database object ® Check you can determine whether the definition of the view on the database is consistent with the active version of the view. With Extras ® Database object ® Display you can display the definition of the view on the database.

With Extras ® Runtime object ® Check you can determine whether the definition for the view in the ABAP Dictionary maintenance is identical to the specifications in the runtime object of the view. With Extras ® Runtime object ® Display you can display the runtime object of the view.

Display foreign key of a view field:

If a foreign key which was automatically included in the view definition is defined for the field of the base table, you can display it. To do so, position the cursor on the view field and choose Extras ® Foreign keys.

See also:

Database Views

Inserts with Database Views

4 REPLIES 4

Former Member
0 Kudos

Database view is used to join multiple database tables.

Place the cursor on View name and press button 'Where Used List', you will get a popup window, from there select only program and continue, you will get list of programs which has used this view.

Reward Points if this helps,

Satish

Former Member
0 Kudos

A database view is defined in the ABAP Dictionary as a logical view on one or more tables. A database view is automatically created in the underlying database when it is activated.

go to se11-> select view radio button->give the view name->and select where used list

http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ecab446011d189700000e8322d00/frameset.htm

Message was edited by:

Muthurajan Ramkumar

Former Member
0 Kudos

what case we use the Database view in our programming.

ans join more than 4 table.

also used for maintain data manually.

Creating a Database View

Enter the name of the view in the initial screen of the ABAP/4 Dictionary, select object class Views and choose Create. A dialog box appears, in which you must choose the type of the view. Select the type Database view.

The maintenance screen for database views appears. You will see three input areas for tables, join conditions and view fields. Carry out the following actions:

Enter a short explanatory text in the field Short text.

In Tables, enter the base tables which you want to include in the view.

Link the included tables with join conditions. Enter the fields which you want to identify in Join conditions.

You can also derive the join conditions from existing foreign keys between the base tables of the view. To do this, position the cursor on the table names and click on Relationships. All foreign keys to other tables defined for this table are displayed. If you only want too see the existing foreign key relationship between two of the tables included in the view, you must select these two tables (click on the tables in the first column of the input area).

Select the foreign key and choose Copy. The join condition is now derived from the definitions in the foreign key (see Foreign Key Relationship and Join Condition).

Select the fields which you want to include in the view.

You can enter the field names directly. If you do not know the field names, you can also copy them from the tables. To do this, position the cursor on a table and click on TabFields. The fields of the table are now displayed in a dialog box. You can copy fields from this by marking the first column and clicking on Copy.

You can also completely include a table in the view. The view then adapts itself automatically to changes in this table. If fields are inserted or deleted in the included table, these fields are automatically inserted or deleted in the view.

In order to include one of the tables in the view, you must enter * in the field Viewfield *, the name of the table to be included in the field Table and * in the field Fieldname. You can also exclude individual fields of an included table. If you do not want to include a field of the included table in the view, you must specify a - in the field Viewfield, the name of the included table in the field Table and the name of the field in the field Fieldname.

Formulate the selection conditions. To do this, choose Goto ® Selection condition. The input area for the selection conditions appears in place of the input areas for the fields. Maintain the selection conditions as described in Maintaining the Selection Condition for a View. You can then switch back to the fields display with Goto ® View fields.

Maintain the technical settings of the view. You can define whether or how the view should be buffered. When maintaining, proceed as for the technical settings of a table (see Maintaining Technical Settings). Note that only the settings for buffering can be maintained for views.

Save your entries. You are requested to assign the view a development class. You can change this development class later with Extras ® Object catalog entry.

Activate the view with View ® Activate. A log is written during activation. You can display this with Utilities ® Activation log. Errors or warnings which occur when the view is activated are displayed directly in the activation log.

When a database view is activated, the corresponding view is also automatically created on the database if the base tables of the view are already created there. If the base tables are not yet created on the database, this is recorded in the activation log. The view is nevertheless activated in the ABAP Dictionary. In this case you can create the relevant database view later with the database utility.

Create documentation about the view with Goto ® Documentation. This documentation is output for example when you print the view with View ® Print.

Optional Settings

You can make the following optional settings:

Change data element of a view field:

Select the Mod column (modify) and choose Enter. The Data element field is now ready for input. Enter the new data element there. This data element must refer to the same domain as the original data element. With the F4 help key for the Data element field, you can display all the data elements which refer to the domain of the field. If you want to assign the original data element again, it is sufficient to reset the Mod flag and choose Enter again.

Change maintenance status:

The maintenance status determines how you can access the view data from ABAP programs (read only, read and change). Choose Extras ® Maintenance status. A dialog box appears, in which you can select the maintenance status for the view. If more than one table is involved in the view, the maintenance status read only cannot be altered.

Display view data:

You can determine which data can be selected using the view with Utilities ® Display data.

Display create statement:

With Extras ® CREATE instruction you can display how the view was created on the database. The statement which was executed when the version of the view currently being edited was created in the database is displayed.

Check functions:

With Extras ® Database object ® Check you can determine whether the definition of the view on the database is consistent with the active version of the view. With Extras ® Database object ® Display you can display the definition of the view on the database.

With Extras ® Runtime object ® Check you can determine whether the definition for the view in the ABAP Dictionary maintenance is identical to the specifications in the runtime object of the view. With Extras ® Runtime object ® Display you can display the runtime object of the view.

Display foreign key of a view field:

If a foreign key which was automatically included in the view definition is defined for the field of the base table, you can display it. To do so, position the cursor on the view field and choose Extras ® Foreign keys.

See also:

Database Views

Inserts with Database Views

former_member404244
Active Contributor
0 Kudos