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

PROBLEM IN INNER JOIN

laxman_sankhla3
Participant
0 Likes
682

HI

can i use directly where condition with out using ON in query.

SELECT AVBELN AAUDAT BKWMENG BARKTX BWERKS BPOSNR

INTO CORRESPONDING FIELDS OF TABLE INT_VBAK

FROM VBAK AS A INNER JOIN VBAP AS B

WHERE B~VSTEL IN S_VSTEL.

thanks.

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
660

Hi,

<b>NO</b>, you cannot, you need to define ON which fields you want to do the JOIN, else ON WHAT CONDTION do you expect the tables to be joined.

This is to make sure that the tables you are joining are related in some way, otherwise there is no meaning in JOINING tables which are noway related to each other.

Regards,

Sesh

5 REPLIES 5
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
661

Hi,

<b>NO</b>, you cannot, you need to define ON which fields you want to do the JOIN, else ON WHAT CONDTION do you expect the tables to be joined.

This is to make sure that the tables you are joining are related in some way, otherwise there is no meaning in JOINING tables which are noway related to each other.

Regards,

Sesh

Read only

Former Member
0 Likes
660

SELECT AVBELN AAUDAT BKWMENG BARKTX BWERKS BPOSNR

INTO CORRESPONDING FIELDS OF TABLE INT_VBAK

FROM VBAK AS A INNER JOIN VBAP AS B

<b>on AVBELN = BVBELN</b>

WHERE B~VSTEL IN S_VSTEL.

Read only

Former Member
0 Likes
660

Hi,

No you have to specify the On condition, it will be the key to join both the tables.

use the vbeln ( document number ) to join both the table.

SELECT AVBELN AAUDAT BKWMENG BARKTX BWERKS BPOSNR

INTO CORRESPONDING FIELDS OF TABLE INT_VBAK

FROM VBAK AS A INNER JOIN VBAP AS B

ON AVBELN = BVBELN.

WHERE B~VSTEL IN S_VSTEL.

Satya.

Read only

Former Member
0 Likes
660

never..

there should be atleast one common field so that u can join two table.

And u have to write that in ON statement.

reward if helpful

Read only

Former Member
0 Likes
660

at least write 1 where statement on which the two table will be joined.the tables both will contain the same field.....after words u can use ur where IN statement

Regards