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
732

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
Read only

Former Member
0 Likes
699

Yes use For all entries

Read only

Former Member
0 Likes
699

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

Read only

Former Member
0 Likes
699

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

Read only

Former Member
0 Likes
699

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.