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

left outer join issue in select

former_member196080
Participant
0 Likes
855

Hi Experts

I'm trying to write code for datasource enhancement and using select with left outer join.

But issue is there is record in left table with id equal to "X" and not in write table my select is not picking up the record. As part of this I need to pick the record in main table even if no entries in write table. Not sure whats the issue here,posting code below

SELECT INTO CORRESPONDING FIELDS OF

     TABLE ITAB

   FROM  main table  AS m left outer join second table AS s ON

       m~id = s~id  where m~inum NE ''.

Please help if you could.

Thanks

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
803

Unable to understand the post. What is "write" table? Could you just explain using the same names as in SELECT? What values do you have in the database? And what exactly is the question?

Overall JOIN is a rather straightforward SQL command and is explained in ABAP documentation.

4 REPLIES 4
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
804

Unable to understand the post. What is "write" table? Could you just explain using the same names as in SELECT? What values do you have in the database? And what exactly is the question?

Overall JOIN is a rather straightforward SQL command and is explained in ABAP documentation.

Read only

0 Likes
803

I think its resolved I was doing reading * which was causing not to read from either tables.

Also another question I've is I'm creating datasource at infoset and for reading few fields on few conditions I'm doing left outer join on the same two tables where I've infoset biuld.

Is that right approach?

Thanks

Read only

0 Likes
803

First, let me correct it : SELECT * works perfectly with an outer join (or there is a bug in the SAP "kernel" but I doubt). You probably have an issue in your whole program.

I don't understand your new question, anyway you should open a new thread, and close this one.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
803

Check the documentation SELECT - JOIN and the examples given there ...