2009 Mar 05 8:27 AM
Hi Abapers,
Can we use FOR ALL ENTRIES while using INNER JOIN?
The issue is as below:
SELECT *
FROM DBTAB1 as A INNER JOIN DBTAB2 as B
FOR ALL ENTRIES IN ITAB WHERE --> some conditions
Just want to know can we use this query?
Thanks,
Hemal
2009 Mar 05 9:01 AM
Hi,
Defnately you can as
select a~field1
a~field2
b~field3
c~field4
from tab1 as a inner join tab2 as b
on afield1 = bfield1
for all entries in i_tab3
into i_tab4 where
a~field5 = some parameter.
regards.
2009 Mar 05 8:30 AM
SELECT *
FROM DBTAB1 as A INNER JOIN DBTAB2 as B
FOR ALL ENTRIES IN ITAB WHERE --> some conditions
instead
use
select * from DBTAB1 into itab1 where on selection screen condition
if sy-subrc = 0 .
select *from dbtab2 where field1 in itab1-field1
just check there should be itab1 fields in where conditions
Hope it helps
2009 Mar 05 8:31 AM
Hello,
Did you try writing this query & then ask. You will find a barrage of answers telling you "Yes, definitely you can", what i like is that you should give a try before posting the question.
@Bhanu: This is not what the OP has asked in the query. Plz read the post carefully before posting irrelevant answers
No hard feelings.
BR,
Suhas
Edited by: Suhas Saha on Mar 5, 2009 9:32 AM
2009 Mar 05 8:34 AM
Hi,
U can use FOR ALL ENTRIES in inner join. But if u can create separate internal tables for all the database tables and fetchig like below..will be good..
select from dbtable1 into itab1 where condition
if itab1 is not initial.
select from dbtable2 into itab2
for all entries in itab1
where condition.
endif.
if itab2 is not initial.
select from dbtable3 into itab3
for all entries in itab2
where condition.
endif.....
Hope this is helpful.
Keerthi
2009 Mar 05 8:54 AM
yes we can use for all entries in joins but better we can use those statements separatly.
2009 Mar 05 9:01 AM
Hi,
Defnately you can as
select a~field1
a~field2
b~field3
c~field4
from tab1 as a inner join tab2 as b
on afield1 = bfield1
for all entries in i_tab3
into i_tab4 where
a~field5 = some parameter.
regards.
2009 Mar 05 9:04 AM
Hi some correction,
if not i_tab3 is initial.
select a~field1
a~field2
b~field3
c~field4
from tab1 as a inner join tab2 as b
on afield1 = bfield1
for all entries in i_tab3
into i_tab4 where
a~field5 = some parameter.
endif.
regards,
2009 Mar 05 9:07 AM
Phaneenra you were absolutely right...Thanks Dude
Edited by: HEMAL SHAH on Mar 5, 2009 10:10 AM