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

Select data from Table1 based on Table2

Former Member
0 Likes
1,103

Hi Guys,

Can you guide me up on how to select data from Table1 based on Table2?

I want to fetch data which is not there in table2 in my table1 select query.

Is that I have to do it with the loops after I select data from both tables or can it be handled directly in my select query?

Please suggest.

Regards,

Kumar.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
862

hi

Try This

In Where condition filedname (Not Equal) < > itab2-fieldname.

select * from itab1

into table lt_tab.

seect * from itab2

into table lt_tab

for all entries in lt_tab

where name < >(Not Equal to)itab2-fieldname.

5 REPLIES 5
Read only

Former Member
0 Likes
862

Hi,

Select from Table1 into itab1

Select from Table2 into itab2 FOR ALL ENTRIES IN itab1

where <conditions>.

Read only

Former Member
0 Likes
863

hi

Try This

In Where condition filedname (Not Equal) < > itab2-fieldname.

select * from itab1

into table lt_tab.

seect * from itab2

into table lt_tab

for all entries in lt_tab

where name < >(Not Equal to)itab2-fieldname.

Read only

Former Member
0 Likes
862

Hi,

Use LEFT OUTER JOIN to meet your requirement.

Thanks,

Sudheer

Read only

0 Likes
862

Thanks for your replies, I would try your suggestions....

Read only

0 Likes
862

Problem solved.