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

DDIC : database View

Former Member
0 Likes
1,487

Can we create a database view in ABAP, where we have Outer join between two tables? If yes, how and where to specify the join condition?

1 ACCEPTED SOLUTION
Read only

Former Member
9 REPLIES 9
Read only

Former Member
0 Likes
1,068

You can create in SE11 ABAP Dictonary...

under the radiobutton views...

you can give the join condition in the subsequent screens

santhosh

Read only

Former Member
Read only

0 Likes
1,068

help.sap says

Quote:

<b>Database views implement an inner join.</b> The database therefore only provides those records for which there is an entry in all the tables used in the view. Help views and maintenance views, however, implement an outer join.

Unquote:

Read only

0 Likes
1,068

Yeah thats right, so for outer views we have to use maintainance views.

Check this link to know more.

~Rohit

Read only

Former Member
0 Likes
1,068

Hi , for creating view , maintaing view plz go throw the following document,

http://help.sap.com/saphelp_47x200/helpdata/en/cf/21ecf9446011d189700000e8322d00/frameset.htm

Reward points if helpful.

Regards

Nilesh

Read only

Former Member
0 Likes
1,068

Hi Harish,

Data about an application object is often distributed on

several database tables. A database view provides an

application-specific view on such distributed data.

Database views are defined in the ABAP Dictionary. A

database view is automatically created in the underlying

database when it is activated.

Application programs can access the data of a database view

using the database interface. You can access the data in

ABAP programs with both OPEN SQL and NATIVE SQL.

However, the data is actually selected in the database. Since

the join operation is executed in the database in this case,

you can minimize the number of database accesses in this

way. Database views implement an inner join.

If the database view only contains a single table, the

maintenance status can be used to determine if data records

can also be inserted with the view. If the database view contains

more than one table, you can only read the data.

Procedure

1> Enter an explanatory short text in the field Short text.

You can for example find the view at a later time using this

short text.

2> Define the tables to be included in the view in the Tables

field of the Tables/Join conditions tab page.

Keep in mind that you can only include transparent tables in a

database view.

3> Link the tables with join conditions.

Place the cursor on a table name and choose Relationships.

All foreign keys to other tables defined for this table are

displayed. Select the foreign keys and choose Copy.

The join condition is now derived from the definitions in the

foreign key.

4> On the View fields tab page, select the fields that you

want to copy to the view.

Choose Table fields. All the tables contained in the view are

displayed in a dialog box. Select a table. All the fields

contained in this table are displayed. You can copy fields

by selecting them in the first column and choosing Copy.

5> On the Selection conditions tab page, you can

(optionally) formulate restrictions for the data records to be

displayed with the view .

The selection conditions define the data records that can be

selected with the view.

6> With Goto - Technical settings , you can (optionally)

maintain the technical settings of the database view.

You can define whether and how the database view should be

buffered here. Proceed as for the technical settings of a table

7> On the Maintenance status tab page, select the

maintenance status of the database view.

If the view contains more than one table, the maintenance

status read only cannot be altered.

8> Save your entries. You are asked to assign the view a

development class.

9> Choose Activate .

****rewards some points.

Rgds,

P.Naganjana Reddy

Read only

Former Member
0 Likes
1,068

HI,

Go to SE11-> selct VIEW radio button and create-->select DATABASE VIEW option and give table and filelds names for joining conditions there it self.

Reward if it useful,

Thanks

Vana

Read only

0 Likes
1,068

I was talking about <b>Outer join</b> condition in Database view.

Read only

Former Member
0 Likes
1,068

As per the help.sap document, we can't create a 'Database View' with outer join conditions. For that we need a maintenance or Help view.