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 and for all entries

Former Member
0 Kudos

hi experts

can we use both inner join and for all entries in the same select statement.

regards,

siri.

1 ACCEPTED SOLUTION

laxmanakumar_appana
Active Contributor

Hi,

Yes , we can use both in one select.

Ex:

SELECT a~fld1
         b~fld2
         INTO CORRESPONDING FIELDS OF TABLE i_tab
         FROM Ztab1 AS a INNER JOIN Ztab2 AS b
         ON    a~fld3 = b~fld3
         FOR ALL ENTRIES IN i_tab2
         WHERE a~fld1 = i_tab2-fld1

check the performance of the program in SE30 , if it is taking much time , then select data into different internal tables , then use Read statements to get correct data into final internal table.

Regards

Appana

*Reward Points for helpful answers

6 REPLIES 6

Former Member
0 Kudos

hi

we cant take inner join and for all entries in the same select statement....

regard,

vishal

laxmanakumar_appana
Active Contributor

Hi,

Yes , we can use both in one select.

Ex:

SELECT a~fld1
         b~fld2
         INTO CORRESPONDING FIELDS OF TABLE i_tab
         FROM Ztab1 AS a INNER JOIN Ztab2 AS b
         ON    a~fld3 = b~fld3
         FOR ALL ENTRIES IN i_tab2
         WHERE a~fld1 = i_tab2-fld1

check the performance of the program in SE30 , if it is taking much time , then select data into different internal tables , then use Read statements to get correct data into final internal table.

Regards

Appana

*Reward Points for helpful answers

0 Kudos

but there is performance difference between these two no.

thats why i had a doubt.

Former Member
0 Kudos

yes we can use both

if not it_matnr[] is initial.

 select a~matnr b~maktx into table it_itab from
        mara as a inner join 
        makt as b on
        a~matnr = b~matnr 
        for all entries in it_matnr
        where a~matnr = it_matnr-matnr.

endif.

ldzierza
Participant
0 Kudos
SELECT STPO~STLTY
       STPO~STLNR
       STPO~STLKN
       STPO~STPOZ
       STPO~IDNRK
       STPO~MEINS FROM MARA AS MARA
  INNER JOIN MAST AS MAST ON MARA~MATNR = MAST~MATNR
    INNER JOIN STPO AS STPO ON MAST~STLNR = STPO~STLNR
  INTO TABLE GT_ZINT_CARR_STPO
  FOR ALL ENTRIES IN GT_ZINT_CARR_MARA
WHERE MARA~MATNR = GT_ZINT_CARR_MARA-MATNR.

0 Kudos

This thread is nearly 18 years old and it is marked as solved. Why are you answering to it?