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

Join Table

Former Member
0 Likes
1,046

Hi,

I read the following doc about abap joins.

http://help.sap.com/abapdocu_70/en/ABAPSELECT_JOIN.htm

and have coded something like this:

SELECT *
  INTO  CORRESPONDING FIELDS OF TABLE itab
  FROM  ( ( ( text AS p
            INNER JOIN book AS f ON p~book = f~book )

            INNER JOIN rep AS c ON c~id = f~id )
            INNER JOIN elt AS t ON t~tu = c~co )

WHERE p~vers = '1' AND
      f~vers = '1' AND
      c~vers = '1' AND
      t~vers = '1' AND
      p~langu   IN langu_s AND
      t~langu   IN langu_s.

Now I would like to have all entries from rep !!!

If I make a Left (outer) Join I have to remove the where clause, but i just want to get vers 1 from rep.

How else can I code it? The best thing would be to get all entries from rep and all from book, and join them if possible...

but ABAP Doc is talking only about inner and left outer join.

Thanks

Moderator Message: Please use a more meaningful subject line.

Edited by: Suhas Saha on Dec 29, 2011 2:29 PM

1 ACCEPTED SOLUTION
Read only

madhu_vadlamani
Active Contributor
0 Likes
1,000

Hi Alto,

but ABAP Doc is talking only about inner and left outer join

Can you explain it.Yes you can check with for all entries.if it is more than three tables for all entries is better than join.

Regards,

Madhu.

8 REPLIES 8
Read only

madhu_vadlamani
Active Contributor
0 Likes
1,001

Hi Alto,

but ABAP Doc is talking only about inner and left outer join

Can you explain it.Yes you can check with for all entries.if it is more than three tables for all entries is better than join.

Regards,

Madhu.

Read only

0 Likes
1,000

Hi

Fromthe discussion which i have a read and personal experince inner join most of the time performs better than for all entires. Please add a condtion for version thats it.

Nabheet

Read only

0 Likes
1,000

Yes Nabheet, but if you use more than 3 tables which have huge data then you need to specify as many number of key fields as you can in the ON and WHERE conditions to avoid performance issue or to run faster than FOR ALL ENTRIES.

Regards,

Selva M

Read only

0 Likes
1,000

JOIN statement bypass SAP buffering and access database table more faster. Of course, you can use BYPASSING BUFFER in FOR ALL ENTRIES too...

depends on the requirement and just adjust accordingly.

Read only

0 Likes
1,000

Hi again,

I am looking for a tool or transaction in SAP that will automatically generate select (join) statements.

I mean it should be possible to say how to join this an that with a particular condition and

i will get a clear select statement, and I only have to adjust it a bit...

Does something like that exists?

Thanks

Read only

0 Likes
1,000

Hi ,

You can not get directly select statement with all the condition with any of the tools provided by SAP. But you can find the join conditions between the tables using SQ01 or SQVI

1. create Quick view ---> Select datasource as Table Join --->Ok

2.Go to edit-->insert tables

then It'll display the layout with join conditions.

Regards,

Selva M

Read only

Former Member
0 Likes
1,000

HI Alto,

You can mention c~vers = '1' in ON condition of Join itself. You don't have to mention it in where condition.

Regards,

Selva M

Read only

mayankmrai
Explorer
0 Likes
1,000

hope you have got the solution to the issue u are facing...

but see to it that to increase the performance of your query avoid using 'corresponding fields of' and 'join conditions' better make use of 'for all entries in'..