Skip to Content

SQ02 InfoSet Left Join Problem

Hi, I'm not sure if this is the correct area to post this, if not please let me know.

In SQ02 I have an InfoSet table left join but the records are only returning as if it's an inner join (Only records that are in both tables). Any ideas? My join screenshot is below and attached in case you can't see enough below..

Capture.JPG (139.8 kB)
Capture.JPG (139.8 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Jul 15, 2016 at 08:57 PM

    When you have a inner join on a table with left outer join (EINA-LFA1), then the left outer join behaves like a inner join. I think that's because when there's no record in EINA, a dummy record of EINA is formed with "null" fields, consequently no record corresponds in LFA1, and finally there's no record for the EINA-LFA1 combination.

    The first solution is to remove table LFA1, or to write several SELECT directly via ABAP using a "data reading program".

    Add a comment
    10|10000 characters needed characters exceeded

    • Sure enough, if I do a test without LFA1 it works fine. But that's unfortunate because then I can't get Vendor name in my query. (And to the guy above, yes, I need EINA because I need the Vendor Material Number that is in that table).

      I was hoping not to have to go to an ABAP program, as I'm not an ABAPer, I can just do queries. I wonder is there any other way, you can't do sub queries right? Like to join together those 2 tables first and then have that be the only piece that I left join against?

      Or maybe a custom field that just has that vendor name so I don't actually have the table as part of the join?

  • Posted on Jul 15, 2016 at 10:21 PM

    Sorry, I didn't notice that you had a two table chain going. Yes, with LEFT JOIN we can't really just keep joining more tables.

    But if you are only interested in the vendor name and material description then you don't need either LFA1 or MAKT. Unless you've purposefully unchecked the text flag when creating the infoset, the corresponding texts will be pulled automatically and will be available in the query. You won't see them in the infoset, but when you go to create a query you'll notice the additional field section at the bottom with many text fields available. Material description and vendor name should be there.

    In addition to the blog Jurgen mentioned, there are many query-related blogs and documents on SCN that you should find helpful.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2016 at 08:20 PM

    I believe this effect occurs when you add a field from the left joined table to the selection screen in query. In ABAP, we cannot actually add WHERE condition to SELECT for such tables, but since with the queries we maintain JOIN in the infoset and selection is usually in the query then it does not trigger any warnings.

    If you try to use the left joined table in the selection then JOIN will, essentially behave as INNER, not LEFT.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2016 at 09:52 PM

    the docu Left Outer Join - Modeling - SAP Library says it: Tables connected with left outer joins always form-figuratively speaking- the end of a chain of tables.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2016 at 08:34 PM

    Bresnt

    These issues you need to resolve by different combinations or gradual joining of tables. First try with 3 tables and see the behavior. (MARD, MARA, EINA).

    But I doubt whether you are using right table (EINA) for your requirement? Whether you need to EKKO instead?

    Regards

    KJogeswaraRao

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 15, 2016 at 09:53 PM

    try left join for MBEW

    Regards Clemens

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.