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: 

inner join

Former Member
0 Kudos

Is it possible to get output without using inner join?

:

select abukrs bnetwr bmwsbk bvbeln b~kunrg

ckunnr clifnr

alifnr axblnr

into corresponding fields of table itab1

from vbrk as b

inner join bsik as a on bvbeln = axblnr

inner join kna1 as c on bkunrg = ckunnr

where a~bukrs IN s_bukrs.

4 REPLIES 4

Former Member
0 Kudos

Yes use For all entries

Former Member
0 Kudos

Hi,

Split the Select and use the For All Entries.

select bukrs lifnr xblnr
into corresponding fields of table itab1
from bsik 
where a~bukrs IN s_bukrs.

select netwr mwsbk vbeln kunrg
into corresponding fields of table itab2
from vbrk 
for all entries in itab1
where vbeln =  itab1-xblnr

select kunnr lifnr
into corresponding fields of table itab3
from kna1 wherekunnr = itab3-kunrg

Former Member
0 Kudos

hi,

Dont use inner join for three table unless all the joining keys are not primary key.

use for all entries.

Check the syntes from f1 help or abapdocu.

Cheers,

Rudhir

former_member342013
Contributor
0 Kudos

Hi

Try This

SELECT BUKRS

LIFNR

XBLNR

FROM BSIK

INTO CORRESPONDING FIELDS OF TABLE ITAB1

WHERE BUKRS IN S_BUKRS.

IF ITAB1[] IS NOT INITIAL.

SELECT VBELN

KUNRG

NETWR

MWSBK

FROM VBRK

INTO TABLE ITAB2

WHERE VBELN = ITAB1-XBLNR.

ENDIF.

IF ITAB2[] IS NOT INITIAL.

SELECT KUNNR

LIFNR

FROM KNA1

INTO TABLE ITAB3

FOR ALL ENTRIES IN ITAB1

WHERE KUNNR = ITAB1-KUNRG.

ENDIF.