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

Inner Join

Former Member
0 Likes
605

Hi all,

I have problem in inner joins

My query is

select avbeln bvgbel from vbrp as a inner join lips as b on avbeln = bvgbel and ( avgpos = bposnr OR avgpos = buecha)

The problem is we cannot use OR in inner joins

Please let me know any alternative

Thanks in advance

Regards

Neha Kapoor

5 REPLIES 5
Read only

naimesh_patel
Active Contributor
0 Likes
577

Hello,

Take all records as,

select avbeln bvgbel from vbrp as a inner join lips as b on avbeln = bvgbel

into internal table,

Then delete based on your vgpos = bposnr OR avgpos = buecha condition.

regards,

Naimesh

Read only

Former Member
0 Likes
577

Hi,

You have to populate the values in the ranges table and pass the ranges table in the where condition with 'in' parameter,

Rgds,

Read only

Former Member
0 Likes
577

Neha,

You can try following query..

select avbeln bvgbel

from vbrp as a

inner join lips as b

on avbeln = bvgbel

where avgpos = bposnr OR avgpos = buecha..

Cheers,

Nilesh

Read only

Former Member
0 Likes
577

hi Neha,

try this

select a~vbeln b~vgbel 
       from vbrp as a inner join 
            lips as b 
             on a~vbeln = b~vgbel and 
                a~vgpos = b~posnr OR 
                a~vgpos = b~uecha.

Read only

Former Member
0 Likes
577

Hi Neha,

Use this code instead:

TABLES: VBRP, LIPS.

SELECT * FROM VBRP.

SELECT * FROM LIPS WHERE vbeln = VBRP-vgbel and

POSNR = VBRP-vgpos OR

UECHA = VBRP-vgpos.

ENDSELECT.

ENDSELECT.

Regards